From 2d2778ca7e8b9eb2650cea6224e080a62fcc7224 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 6 May 2014 15:49:04 +0200 Subject: add monotone macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/libmdsserver/macros.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/libmdsserver') diff --git a/src/libmdsserver/macros.h b/src/libmdsserver/macros.h index bb4e1c3..b464732 100644 --- a/src/libmdsserver/macros.h +++ b/src/libmdsserver/macros.h @@ -24,6 +24,7 @@ #include #include #include +#include */ @@ -215,5 +216,16 @@ (geteuid() == getuid() ? 0 : seteuid(getuid()))) +/** + * Wrapper for `clock_gettime` that gets some kind of + * monotonic time, the exact clock ID is not specified + * + * @param time_slot:struct timespec* Pointer to the variable in which to store the time + * @return :int Zero on sucess, -1 on error + */ +#define monotone(time_slot) \ + clock_gettime(CLOCK_MONOTONIC, time_slot) + + #endif -- cgit v1.2.3-70-g09d2