diff options
Diffstat (limited to 'contrib/blacklist/port/clock_gettime.c')
-rw-r--r-- | contrib/blacklist/port/clock_gettime.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/contrib/blacklist/port/clock_gettime.c b/contrib/blacklist/port/clock_gettime.c new file mode 100644 index 000000000000..284bd8176901 --- /dev/null +++ b/contrib/blacklist/port/clock_gettime.c @@ -0,0 +1,17 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <time.h> +#include <sys/time.h> + +int +clock_gettime(int clock __unused, struct timespec *ts) +{ + struct timeval tv; + if (gettimeofday(&tv, NULL) == -1) + return -1; + ts->tv_sec = tv.tv_sec; + ts->tv_nsec = tv.tv_usec * 1000; + return 0; +} |