diff options
Diffstat (limited to 'libc-top-half/musl/src/time/timespec_get.c')
-rw-r--r-- | libc-top-half/musl/src/time/timespec_get.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libc-top-half/musl/src/time/timespec_get.c b/libc-top-half/musl/src/time/timespec_get.c new file mode 100644 index 0000000..40ea9c1 --- /dev/null +++ b/libc-top-half/musl/src/time/timespec_get.c @@ -0,0 +1,10 @@ +#include <time.h> + +/* There is no other implemented value than TIME_UTC; all other values + * are considered erroneous. */ +int timespec_get(struct timespec * ts, int base) +{ + if (base != TIME_UTC) return 0; + int ret = __clock_gettime(CLOCK_REALTIME, ts); + return ret < 0 ? 0 : base; +} |