include/posix: incorporate toolchain-provided time.h header

Some of what's supposed to be in <time.h> was lost because this header
attempts to define everything using more primitive include files.
Instead incorporate the contents from the toolchain-provided header.
Any gaps should be picked up by the legacy content present in this
file, which should not conflict with the toolchain header.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
Peter Bigot 2020-04-28 09:31:37 -05:00 committed by Carles Cufí
parent 4f54b4176d
commit 3cb353c09f

View file

@ -6,6 +6,11 @@
#ifndef ZEPHYR_INCLUDE_POSIX_TIME_H_
#define ZEPHYR_INCLUDE_POSIX_TIME_H_
/* Read standard header. This may find <posix/time.h> since they
* refer to the same file when include/posix is in the search path.
*/
#include <time.h>
#ifdef CONFIG_NEWLIB_LIBC
/* Kludge to support outdated newlib version as used in SDK 0.10 for Xtensa */
#include <newlib.h>
@ -101,4 +106,9 @@ int nanosleep(const struct timespec *rqtp, struct timespec *rmtp);
#include <syscalls/time.h>
#endif /* CONFIG_ARCH_POSIX */
#else /* ZEPHYR_INCLUDE_POSIX_TIME_H_ */
/* Read the toolchain header when <posix/time.h> finds itself on the
* first attempt.
*/
#include_next <time.h>
#endif /* ZEPHYR_INCLUDE_POSIX_TIME_H_ */