mirror of
https://github.com/cesanta/mongoose.git
synced 2024-11-27 20:59:00 +08:00
move dependencies
This commit is contained in:
parent
c8f5f85635
commit
6ae59c3711
@ -73,12 +73,8 @@ static int event_next(int no, struct event *e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This is for newlib and TLS (mbedTLS)
|
// This is for newlib and TLS (mbedTLS)
|
||||||
int _gettimeofday(struct timeval *tv, void *tz) {
|
uint64_t mg_now(void) {
|
||||||
uint64_t now = mg_millis() + s_boot_timestamp;
|
return mg_millis() + s_boot_timestamp;
|
||||||
(void) tz;
|
|
||||||
tv->tv_sec = (time_t) (now / 1000);
|
|
||||||
tv->tv_usec = (unsigned long) ((now % 1000) * 1000);
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SNTP connection event handler. When we get a response from an SNTP server,
|
// SNTP connection event handler. When we get a response from an SNTP server,
|
||||||
|
@ -86,3 +86,13 @@ int mkdir(const char *path, mode_t mode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _init(void) {}
|
void _init(void) {}
|
||||||
|
|
||||||
|
extern uint64_t mg_now(void);
|
||||||
|
|
||||||
|
int _gettimeofday(struct timeval *tv, void *tz) {
|
||||||
|
uint64_t now = mg_now();
|
||||||
|
(void) tz;
|
||||||
|
tv->tv_sec = (time_t) (now / 1000);
|
||||||
|
tv->tv_usec = (unsigned long) ((now % 1000) * 1000);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user