summaryrefslogtreecommitdiff
path: root/ports/winnt/libntp/util_clockstuff.c
diff options
context:
space:
mode:
Diffstat (limited to 'ports/winnt/libntp/util_clockstuff.c')
-rw-r--r--ports/winnt/libntp/util_clockstuff.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/ports/winnt/libntp/util_clockstuff.c b/ports/winnt/libntp/util_clockstuff.c
new file mode 100644
index 000000000000..e4bd0de3dd24
--- /dev/null
+++ b/ports/winnt/libntp/util_clockstuff.c
@@ -0,0 +1,26 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "ntp_syslog.h"
+#include "ntp_stdlib.h"
+#include "ntp_unixtime.h"
+#include "clockstuff.h"
+
+int
+gettimeofday(
+ struct timeval * tv,
+ void * ignored
+ )
+{
+ struct timespec ts;
+
+ UNUSED_ARG(ignored);
+
+ getclock(TIMEOFDAY, &ts);
+
+ tv->tv_sec = ts.tv_sec;
+ tv->tv_usec = ts.tv_nsec / 10;
+
+ return 0;
+}