Fix: use lttng_clock_gettime instead of clock_gettime
[lttng-tools.git] / tests / utils / utils.c
index e7bd9ce9fbeef567bd8abb79434f8d728f6813c3..0b9655247e81ba30604b88891e352ed553e960a5 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");
@@ -57,7 +55,7 @@ int usleep_safe(useconds_t usec)
                        goto end;
                }
 
-               ret = clock_gettime(CLOCK_MONOTONIC, &t2);
+               ret = lttng_clock_gettime(CLOCK_MONOTONIC, &t2);
                if (ret) {
                        perror("clock_gettime");
                        goto end;
This page took 0.024724 seconds and 5 git commands to generate.