musl-tcc/src/time/time.c

11 lines
170 B
C
Raw Normal View History

2022-03-20 08:48:53 +00:00
#include <time.h>
#include "syscall.h"
time_t time(time_t *t)
{
struct timespec ts;
__clock_gettime(CLOCK_REALTIME, &ts);
if (t) *t = ts.tv_sec;
return ts.tv_sec;
}