Follow the approach of newlib to use a file sys/_types.h to specify the underlying type for POSIX/libc types that must be provided in multiple headers. The identifier for this type is in the reserved namespace. Use this type rather than a specific standard type in all headers that need to provide the type under its public name. Remove the inclusion of <sys/types.h> from headers that should not bring in all symbols present in that header, replacing it with the standard boilerplate to expose the specific symbols that are required. Signed-off-by: Peter A. Bigot <pab@pabigot.com>
28 lines
543 B
C
28 lines
543 B
C
/*
|
|
* Copyright (c) 2019 Linaro Limited
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#ifndef ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_SYS__TIMEVAL_H_
|
|
#define ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_SYS__TIMEVAL_H_
|
|
|
|
#include <sys/_types.h>
|
|
|
|
#if !defined(__time_t_defined)
|
|
#define __time_t_defined
|
|
typedef _TIME_T_ time_t;
|
|
#endif
|
|
|
|
#if !defined(__suseconds_t_defined)
|
|
#define __suseconds_t_defined
|
|
typedef _SUSECONDS_T_ suseconds_t;
|
|
#endif
|
|
|
|
struct timeval {
|
|
time_t tv_sec;
|
|
suseconds_t tv_usec;
|
|
};
|
|
|
|
#endif /* ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_SYS__TIMEVAL_H_ */
|