Changeset View
Changeset View
Standalone View
Standalone View
contrib/blacklist/port/clock_gettime.c
- This file was added.
Property | Old Value | New Value |
---|---|---|
svn:eol-style | null | native \ No newline at end of property |
svn:keywords | null | FreeBSD=%H \ No newline at end of property |
svn:mime-type | null | text/plain \ No newline at end of property |
#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; | |||||
} |