diff options
Diffstat (limited to 'userland/libc/time/time.c')
-rw-r--r-- | userland/libc/time/time.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/userland/libc/time/time.c b/userland/libc/time/time.c new file mode 100644 index 0000000..9931b71 --- /dev/null +++ b/userland/libc/time/time.c @@ -0,0 +1,9 @@ +#include <time.h> + +time_t time(time_t *tloc) { + struct timespec ts; + clock_gettime(CLOCK_REALTIME, &ts); + if (tloc) + *tloc = ts.tv_sec; + return ts.tv_sec; +} |