summaryrefslogtreecommitdiff
path: root/lib/replace
diff options
context:
space:
mode:
authorBjörn Jacke <bj@sernet.de>2010-08-26 12:22:02 +0200
committerBjörn Jacke <bj@sernet.de>2010-08-31 10:24:37 +0200
commit63b1f2ee813b430e1f4bec3abb28a6266f8a82c8 (patch)
tree15e9d4d3099d974a8c25ef493ebedd21192123e4 /lib/replace
parent8c6ca6e25a4d33e4f9ae2ef13a3872cd533ba6f6 (diff)
downloadsamba-63b1f2ee813b430e1f4bec3abb28a6266f8a82c8.tar.gz
samba-63b1f2ee813b430e1f4bec3abb28a6266f8a82c8.tar.bz2
samba-63b1f2ee813b430e1f4bec3abb28a6266f8a82c8.zip
libreplace: make a define for a best effort monotonic clock
Diffstat (limited to 'lib/replace')
-rw-r--r--lib/replace/system/time.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/replace/system/time.h b/lib/replace/system/time.h
index ff26531e45..3605d2692e 100644
--- a/lib/replace/system/time.h
+++ b/lib/replace/system/time.h
@@ -67,9 +67,16 @@ int rep_utimes(const char *filename, const struct timeval tv[2]);
#endif
#ifndef HAVE_CLOCK_GETTIME
+/* CLOCK_REALTIME is required by POSIX */
#define CLOCK_REALTIME 0
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
+#define CUSTOM_CLOCK_MONOTONIC CLOCK_MONOTONIC
+#endif
#endif