1 /* 2 * Copyright (c) 2019 Linaro Limited 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef ZEPHYR_INCLUDE_POSIX_SYS_TIME_H_ 8 #define ZEPHYR_INCLUDE_POSIX_SYS_TIME_H_ 9 10 #ifdef CONFIG_NEWLIB_LIBC 11 /* Kludge to support outdated newlib version as used in SDK 0.10 for Xtensa */ 12 #include <newlib.h> 13 14 #ifdef __NEWLIB__ 15 #include <sys/_timeval.h> 16 #else 17 #include <sys/types.h> 18 struct timeval { 19 time_t tv_sec; 20 suseconds_t tv_usec; 21 }; 22 #endif 23 24 #else 25 #include <sys/_timeval.h> 26 #endif /* CONFIG_NEWLIB_LIBC */ 27 28 #ifdef __cplusplus 29 extern "C" { 30 #endif 31 32 int gettimeofday(struct timeval *tv, const void *tz); 33 34 #ifdef __cplusplus 35 } 36 #endif 37 38 #endif /* ZEPHYR_INCLUDE_POSIX_SYS_TIME_H_ */ 39