Default to CS_GTOD if CONFIG_CLOCK_GETTIME isn't defined.
authorBruce Cran <bruce@cran.org.uk>
Sat, 2 Feb 2013 20:54:36 +0000 (20:54 +0000)
committerJens Axboe <axboe@kernel.dk>
Sun, 3 Feb 2013 12:49:32 +0000 (13:49 +0100)
Defaulting the clock source to CS_CGETTIME broke on OS X because it
doesn't have clock_gettime. Use CS_GTOD if CONFIG_CLOCK_GETTIME isn't
defined.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
os/os.h

diff --git a/os/os.h b/os/os.h
index ef9f91f523b6f7c15ebe7871b717c96c9ef61a8c..ce331601eafe9fdb5a22303031551ee1607aac2a 100644 (file)
--- a/os/os.h
+++ b/os/os.h
@@ -125,7 +125,11 @@ typedef unsigned long os_cpu_mask_t;
 #endif
 
 #ifndef FIO_PREFERRED_CLOCK_SOURCE
+#ifdef CONFIG_CLOCK_GETTIME
 #define FIO_PREFERRED_CLOCK_SOURCE     CS_CGETTIME
+#else
+#define FIO_PREFERRED_CLOCK_SOURCE     CS_GTOD
+#endif
 #endif
 
 #ifndef FIO_MAX_JOBS