xref: /aosp_15_r20/external/musl/src/time/timespec_get.c (revision c9945492fdd68bbe62686c5b452b4dc1be3f8453)
1 #include <time.h>
2 
3 /* There is no other implemented value than TIME_UTC; all other values
4  * are considered erroneous. */
timespec_get(struct timespec * ts,int base)5 int timespec_get(struct timespec * ts, int base)
6 {
7 	if (base != TIME_UTC) return 0;
8 	int ret = __clock_gettime(CLOCK_REALTIME, ts);
9 	return ret < 0 ? 0 : base;
10 }
11