summaryrefslogtreecommitdiff
path: root/src/lib/time_utils.c
diff options
context:
space:
mode:
authordimitri staessens <[email protected]>2016-08-31 14:29:32 +0200
committerdimitri staessens <[email protected]>2016-08-31 14:29:32 +0200
commit857c014a40a75eda574af8b2002b1c794bc0975c (patch)
tree721c6c6a7b394dc758ffa12bb3a1261d9817207f /src/lib/time_utils.c
parent1071824054828b9be36f50416f858c49c9acd701 (diff)
parent63b63e0f6ab9f743fc34623bb1caa9852227f046 (diff)
downloadouroboros-857c014a40a75eda574af8b2002b1c794bc0975c.tar.gz
ouroboros-857c014a40a75eda574af8b2002b1c794bc0975c.zip
Merge branch 'be' of bitbucket.org:ouroboros-rina/ouroboros into be
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