Fix: time redefinition warnings on macOS builds
[lttng-tools.git] / tests / utils / utils.c
index e7bd9ce9fbeef567bd8abb79434f8d728f6813c3..b85f027e0b41364f5795dcf328710e33c9b16c6f 100644 (file)
  */
 
 #include <stdint.h>
-#include <time.h>
+#include <common/compat/time.h>
+#include <common/time.h>
 #include <assert.h>
 #include <unistd.h>
 #include <stdio.h>
 #include <errno.h>
 
-#define NSEC_PER_SEC 1000000000ULL
-#define NSEC_PER_USEC 1000ULL
-
 static inline
 int64_t elapsed_time_ns(struct timespec *t1, struct timespec *t2)
 {
@@ -43,7 +41,7 @@ int usleep_safe(useconds_t usec)
        struct timespec t1, t2;
        int64_t time_remaining_ns = (int64_t) usec * (int64_t) NSEC_PER_USEC;
 
-       ret = clock_gettime(CLOCK_MONOTONIC, &t1);
+       ret = lttng_clock_gettime(CLOCK_MONOTONIC, &t1);
        if (ret) {
                ret = -1;
                perror("clock_gettime");
This page took 0.023422 seconds and 4 git commands to generate.