summaryrefslogtreecommitdiff
path: root/lib/replace
diff options
context:
space:
mode:
authorBjörn Jacke <bj@sernet.de>2010-09-14 14:08:44 +0200
committerBjörn Jacke <bj@sernet.de>2010-09-14 22:11:59 +0200
commit9c00fb4aa68ac7b044e954906e5ed20e039373a3 (patch)
treed18e49fbe1b48123a6d61d04e01ddedbae24a9e9 /lib/replace
parent33da33c59e431f6f097bdd143fb48db465607669 (diff)
downloadsamba-9c00fb4aa68ac7b044e954906e5ed20e039373a3.tar.gz
samba-9c00fb4aa68ac7b044e954906e5ed20e039373a3.tar.bz2
samba-9c00fb4aa68ac7b044e954906e5ed20e039373a3.zip
libreplace: use CLOCK_HIGHRES when available
in Solaris 8 CLOCK_HIGHRES was the (only) name for CLOCK_MONOTONIC
Diffstat (limited to 'lib/replace')
-rw-r--r--lib/replace/system/time.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/replace/system/time.h b/lib/replace/system/time.h
index 3605d2692e..5fce4dbc45 100644
--- a/lib/replace/system/time.h
+++ b/lib/replace/system/time.h
@@ -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