blob: 4b95e7527d440b05b55ca100b465cd79feff652e [file] [log] [blame]
Rich Felker0b44a032011-02-12 00:22:29 -05001#include <time.h>
Rich Felker0b44a032011-02-12 00:22:29 -05002#include "syscall.h"
3
Rich Felkere3eb4932011-07-23 23:45:33 -04004int __clock_gettime(clockid_t, struct timespec *);
5
Rich Felker0b44a032011-02-12 00:22:29 -05006time_t time(time_t *t)
7{
Rich Felkere3eb4932011-07-23 23:45:33 -04008 struct timespec ts;
9 __clock_gettime(CLOCK_REALTIME, &ts);
10 if (t) *t = ts.tv_sec;
11 return ts.tv_sec;
Rich Felker0b44a032011-02-12 00:22:29 -050012}