summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSami Kerola2019-01-07 22:31:34 +0100
committerSami Kerola2019-01-12 09:46:53 +0100
commitee6e39305c55d04e647c294898568ed1d3699638 (patch)
treee33e68f4129f2b5faafd6264b0588a7eee763470 /include
parenttimeutils: match today day and this year correctly (diff)
downloadkernel-qcow2-util-linux-ee6e39305c55d04e647c294898568ed1d3699638.tar.gz
kernel-qcow2-util-linux-ee6e39305c55d04e647c294898568ed1d3699638.tar.xz
kernel-qcow2-util-linux-ee6e39305c55d04e647c294898568ed1d3699638.zip
include: add indirect monotonic clock id specifier
Avoid repeated ifdef checks in code by adding a project specific preprocessor definition. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'include')
-rw-r--r--include/monotonic.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/monotonic.h b/include/monotonic.h
index a499fa34a..296173ece 100644
--- a/include/monotonic.h
+++ b/include/monotonic.h
@@ -1,6 +1,12 @@
#ifndef UTIL_LINUX_MONOTONIC_H
#define UTIL_LINUX_MONOTONIC_H
+# ifdef CLOCK_MONOTONIC_RAW
+# define UL_CLOCK_MONOTONIC CLOCK_MONOTONIC_RAW
+# else
+# define UL_CLOCK_MONOTONIC CLOCK_MONOTONIC
+# endif
+
#include <sys/time.h>
extern int get_boot_time(struct timeval *boot_time);