blob: 7547acb1deacfe43b8cfaba5a35ec267e3aaea29 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
#include <time.h>
#include <sys/time.h>
time_t time(time_t*t) {
struct timeval tv;
time_t ret;
if (gettimeofday(&tv,0)) {
ret=(time_t)-1;
} else {
ret=(time_t)tv.tv_sec;
}
if (t) *t=ret;
return ret;
}
|