summaryrefslogtreecommitdiff
path: root/userland/libc/time/time.c
blob: fa025ce537e5c1f9af90394df631889bf2599344 (plain)
1
2
3
4
5
6
7
8
9
10
#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;
}