File: __time.c

package info (click to toggle)
dietlibc 0.34~cvs20160606-10
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 11,336 kB
  • sloc: ansic: 71,631; asm: 13,006; cpp: 1,860; makefile: 799; sh: 292; perl: 62
file content (15 lines) | stat: -rw-r--r-- 252 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <sys/time.h>
#include <time.h>
#include <syscalls.h>

#ifndef __NR_time
time_t time(time_t *t)
{
  struct timeval tv;
  if (__unlikely(gettimeofday(&tv, NULL) < 0))
    tv.tv_sec = -1;
  if (t)
    *t = tv.tv_sec;
  return tv.tv_sec;
}
#endif