util: use clock_gettime() on PIPE_OS_BSD
authorJonathan Gray <jsg@jsg.id.au>
Wed, 28 Feb 2018 10:19:19 +0000 (21:19 +1100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 1 Mar 2018 18:44:38 +0000 (18:44 +0000)
OpenBSD, FreeBSD, NetBSD and DragonFlyBSD all have clock_gettime()
so use it when PIPE_OS_BSD is defined.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/util/os_time.c

index 72dc7e49c0e5595839162eb4b0b7d9abf60f9cd9..ac488b2287cb63b7c6c0dd62cc5c4027c15d23a4 100644 (file)
@@ -55,7 +55,7 @@
 int64_t
 os_time_get_nano(void)
 {
-#if defined(PIPE_OS_LINUX)
+#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD)
 
    struct timespec tv;
    clock_gettime(CLOCK_MONOTONIC, &tv);