Changes for kernel and Busybox
[tomato.git] / release / src / router / bpalogin / get_time.c
blob62cbbbc9d4fba37b820db9eb2f8d8ca90cc0c9c3
1 #include <stdio.h>
2 #include <sys/sysinfo.h>
3 #include <time.h>
5 #define USE_UPTIME 1
7 // When system time change, the lease table will error, so we use system uptime
8 time_t // long int
9 get_time(time_t *t){
10 #ifdef USE_UPTIME
11 struct sysinfo info;
13 sysinfo(&info);
15 return info.uptime;
16 #else
17 return time(0);
18 #endif