summaryrefslogtreecommitdiffhomepage
path: root/dbutil.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2018-02-08 22:07:59 +0800
committerMatt Johnston <matt@ucc.asn.au>2018-02-08 22:07:59 +0800
commitf581ef945373cd8dc427ab947768e84566a18984 (patch)
treee56571c4646d3ba6f2c2a0ed08f0efa4571e6459 /dbutil.c
parentb65354d2375affd3032c94c372b0cc74cb4acedc (diff)
define CLOCK_MONOTONIC if needed
Diffstat (limited to 'dbutil.c')
-rw-r--r--dbutil.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/dbutil.c b/dbutil.c
index ac59f8b..1134dd6 100644
--- a/dbutil.c
+++ b/dbutil.c
@@ -634,6 +634,10 @@ reach userspace include headers */
#ifndef CLOCK_MONOTONIC_COARSE
#define CLOCK_MONOTONIC_COARSE 6
#endif
+/* Some old toolchains know SYS_clock_gettime but not CLOCK_MONOTONIC */
+#ifndef CLOCK_MONOTONIC
+#define CLOCK_MONOTONIC 1
+#endif
static clockid_t get_linux_clock_source() {
struct timespec ts;
if (syscall(SYS_clock_gettime, CLOCK_MONOTONIC_COARSE, &ts) == 0) {