uloop: add a clock_gettime() implementation for mac os x
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
parent
76f584c761
commit
aa4f3bde06
2 changed files with 51 additions and 0 deletions
11
utils.h
11
utils.h
|
@ -20,6 +20,8 @@
|
|||
#define __LIBUBOX_UTILS_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
|
||||
/*
|
||||
* calloc_a(size_t len, [void **addr, size_t len,...], NULL)
|
||||
|
@ -52,4 +54,13 @@ extern int __BUILD_BUG_ON_CONDITION_FAILED;
|
|||
#define BUILD_BUG_ON __BUILD_BUG_ON
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
||||
#define CLOCK_REALTIME 0
|
||||
#define CLOCK_MONOTONIC 1
|
||||
|
||||
void clock_gettime(int type, struct timespec *tv);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue