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

time_t time(time_t *t)
{
	struct timeval tv;
	syscall2(__NR_gettimeofday, (long)&tv, 0);
	if (t) *t = tv.tv_sec;
	return tv.tv_sec;
}