summaryrefslogtreecommitdiff
path: root/src/time/time.c
blob: 22754850d8e4bf4e6792779714610b018ee63825 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <time.h>
#include <sys/time.h>
#include "syscall.h"

int __clock_gettime(clockid_t, struct timespec *);

time_t time(time_t *t)
{
	struct timespec ts;
	__clock_gettime(CLOCK_REALTIME, &ts);
	if (t) *t = ts.tv_sec;
	return ts.tv_sec;
}