From 63b1f2ee813b430e1f4bec3abb28a6266f8a82c8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Jacke?= Date: Thu, 26 Aug 2010 12:22:02 +0200 Subject: [PATCH] libreplace: make a define for a best effort monotonic clock --- lib/replace/system/time.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/replace/system/time.h b/lib/replace/system/time.h index ff26531e45b..3605d2692e8 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 -- 2.11.4.GIT