summaryrefslogtreecommitdiff
path: root/src/lib/time_utils.c
diff options
context:
space:
mode:
authordimitri staessens <[email protected]>2016-08-30 14:29:08 +0200
committerdimitri staessens <[email protected]>2016-08-30 21:44:34 +0200
commit04eb03136466a18d81511e7ccadf51c08faa8edb (patch)
tree721c6c6a7b394dc758ffa12bb3a1261d9817207f /src/lib/time_utils.c
parent2cc89f6da424ab503af563e0cc92dda43b8f8432 (diff)
downloadouroboros-04eb03136466a18d81511e7ccadf51c08faa8edb.tar.gz
ouroboros-04eb03136466a18d81511e7ccadf51c08faa8edb.zip
lib, ipcp: Compile on Apple junk
Disables robust mutexes and clock attributes for condition variables for compatibility with OSX (SUSv2). Implements clock_gettime and adds some defines for OSX compatibility in time_utils.
Diffstat (limited to 'src/lib/time_utils.c')
-rw-r--r--src/lib/time_utils.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/time_utils.c b/src/lib/time_utils.c
index d0b312da..b34e4763 100644
--- a/src/lib/time_utils.c
+++ b/src/lib/time_utils.c
@@ -140,3 +140,15 @@ int ts_to_tv(const struct timespec * src,
return 0;
}
+
+#ifdef __APPLE__
+int clock_gettime(int clock, struct timespec * t)
+{
+ struct timeval tv;
+ int ret = gettimeofday(&tv, NULL);
+ t->tv_sec = tv.tv_sec;
+ t->tv_nsec = tv.tv_usec * 1000;
+ (void) clock;
+ return ret;
+}
+#endif