summaryrefslogtreecommitdiff
path: root/src/time/timespec_get.c
blob: e396da09b34ce6f6b8c38d4714f4f756856a2a6b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
#define _BSD_SOURCE
#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;
}