diff dbutil.c @ 1468:b528e3753af4

define CLOCK_MONOTONIC if needed
author Matt Johnston <matt@ucc.asn.au>
date Thu, 08 Feb 2018 22:07:59 +0800
parents fb90a5ba84e0
children 2d450c1056e3
line wrap: on
line diff
--- a/dbutil.c	Fri Jan 26 00:32:39 2018 +0800
+++ b/dbutil.c	Thu Feb 08 22:07:59 2018 +0800
@@ -634,6 +634,10 @@
 #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) {