libreplace: use CLOCK_HIGHRES when available
authorBjörn Jacke <bj@sernet.de>
Tue, 14 Sep 2010 12:08:44 +0000 (14:08 +0200)
committerBjörn Jacke <bj@sernet.de>
Thu, 16 Sep 2010 19:47:08 +0000 (21:47 +0200)
in Solaris 8 CLOCK_HIGHRES was the (only) name for CLOCK_MONOTONIC
(cherry picked from commit 9c00fb4aa68ac7b044e954906e5ed20e039373a3)

lib/replace/system/time.h

index 3605d2692e85a10dc53714be19e7966a982cb91e..5fce4dbc45b4203fe8a79c732692d3fd90aeb51e 100644 (file)
@@ -73,10 +73,12 @@ typedef int clockid_t;
 int rep_clock_gettime(clockid_t clk_id, struct timespec *tp);
 #endif
 /* make sure we have a best effort CUSTOM_CLOCK_MONOTONIC we can rely on */
-#ifndef CLOCK_MONOTONIC
-#define CUSTOM_CLOCK_MONOTONIC CLOCK_REALTIME
-#else
+#if defined(CLOCK_MONOTONIC)
 #define CUSTOM_CLOCK_MONOTONIC CLOCK_MONOTONIC
+#elif defined(CLOCK_HIGHRES)
+#define CUSTOM_CLOCK_MONOTONIC CLOCK_HIGHRES
+#else
+#define CUSTOM_CLOCK_MONOTONIC CLOCK_REALTIME
 #endif
 
 #endif