aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmdsserver
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-05-06 15:49:04 +0200
committerMattias Andrée <maandree@operamail.com>2014-05-06 15:49:04 +0200
commit2d2778ca7e8b9eb2650cea6224e080a62fcc7224 (patch)
treeea15ca052f40ece16926eee1c65af0d6a07de21d /src/libmdsserver
parentadd strequals and startswith macros + add drop_privileges macro that drops the group before the user (diff)
downloadmds-2d2778ca7e8b9eb2650cea6224e080a62fcc7224.tar.gz
mds-2d2778ca7e8b9eb2650cea6224e080a62fcc7224.tar.bz2
mds-2d2778ca7e8b9eb2650cea6224e080a62fcc7224.tar.xz
add monotone macro
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/libmdsserver')
-rw-r--r--src/libmdsserver/macros.h12
1 files changed, 12 insertions, 0 deletions
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 <unistd.h>
#include <pthread.h>
#include <string.h>
+#include <time.h>
*/
@@ -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