Lely core libraries 2.3.4
time.c
Go to the documentation of this file.
1
23#include "libc.h"
24
25#if !LELY_NO_RT
26
27#include <lely/libc/time.h>
28
29#if !LELY_HAVE_TIMESPEC_GET
30
31int
32timespec_get(struct timespec *ts, int base)
33{
34 if (base != TIME_UTC || clock_gettime(CLOCK_REALTIME, ts) == -1)
35 return 0;
36 return base;
37}
38
39#endif // !LELY_HAVE_TIMESPEC_GET
40
41#endif // !LELY_NO_RT
int timespec_get(struct timespec *ts, int base)
Sets the interval at ts to hold the current calendar time based on the specified time base.
Definition time.c:32
This header file is part of the C11 and POSIX compatibility library; it includes <time....
#define TIME_UTC
An integer constant greater than 0 that designates the UTC time base.
Definition time.h:207
This is the internal header file of the C11 and POSIX compatibility library.
A time type with nanosecond resolution.
Definition time.h:88