posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
time.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 Linaro Limited
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
17#ifndef ZEPHYR_INCLUDE_POSIX_SYS_TIME_H_
18#define ZEPHYR_INCLUDE_POSIX_SYS_TIME_H_
19
20#ifdef CONFIG_NEWLIB_LIBC
21/* Kludge to support outdated newlib version as used in SDK 0.10 for Xtensa */
22#include <newlib.h>
23
24#ifdef __NEWLIB__
25#include <sys/_timeval.h>
26#else
27#include <sys/types.h>
28struct timeval {
29 time_t tv_sec;
31};
32#endif
33
34#else
35#include <sys/types.h>
36#include <sys/_timeval.h>
37#endif /* CONFIG_NEWLIB_LIBC */
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
53int gettimeofday(struct timeval *tv, void *tz);
54
55
56#ifdef __cplusplus
57}
58#endif
59
60#endif /* ZEPHYR_INCLUDE_POSIX_SYS_TIME_H_ */
long suseconds_t
Microsecond time component type.
Definition select.h:55
int gettimeofday(struct timeval *tv, void *tz)
Get the current time with microsecond resolution.
Time value with microsecond resolution.
Definition select.h:79
suseconds_t tv_usec
Microseconds [0, 999999].
Definition select.h:81
time_t tv_sec
Seconds.
Definition select.h:80
POSIX fundamental types (<sys/types.h>)