summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
395d6b0)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBUUID], [test "x$link_with_libuuid" = "xyes"])
AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBC_UUID], [test "x$link_with_libc_uuid" = "xyes"])
AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBUUID], [test "x$link_with_libuuid" = "xyes"])
AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBC_UUID], [test "x$link_with_libc_uuid" = "xyes"])
+AC_CHECK_FUNC([clock_gettime], [AC_DEFINE_UNQUOTED([LTTNG_HAVE_CLOCK_GETTIME], 1, [Has clock_gettime() support.])])
+
# URCU library version needed or newer
m4_define([WRONG_LIBURCU_MSG], [Userspace RCU (liburcu) >= 0.8.0 is needed])
# URCU library version needed or newer
m4_define([WRONG_LIBURCU_MSG], [Userspace RCU (liburcu) >= 0.8.0 is needed])
#include <time.h>
#ifdef __APPLE__
#include <time.h>
#ifdef __APPLE__
typedef uint64_t timer_t;
typedef uint64_t timer_t;
#include <mach/mach.h>
#include <mach/clock.h>
#include <mach/mach.h>
#include <mach/clock.h>
#undef NSEC_PER_MSEC
#undef NSEC_PER_USEC
#undef NSEC_PER_MSEC
#undef NSEC_PER_USEC
+#endif /* __APPLE__ */
+
+/* macOS/OS X 10.12 (Sierra) and up provide clock_gettime() */
+#if defined(__APPLE__) && !defined(LTTNG_HAVE_CLOCK_GETTIME)
+
+typedef int clockid_t;
#define CLOCK_REALTIME CALENDAR_CLOCK
#define CLOCK_MONOTONIC SYSTEM_CLOCK
#define CLOCK_REALTIME CALENDAR_CLOCK
#define CLOCK_MONOTONIC SYSTEM_CLOCK
+#else /* __APPLE__ && !LTTNG_HAVE_CLOCK_GETTIME */
static inline
int lttng_clock_gettime(clockid_t clk_id, struct timespec *tp)
static inline
int lttng_clock_gettime(clockid_t clk_id, struct timespec *tp)
return clock_gettime(clk_id, tp);
}
return clock_gettime(clk_id, tp);
}
+#endif /* __APPLE__ && !LTTNG_HAVE_CLOCK_GETTIME */
#endif /* _COMPAT_TIME_H */
#endif /* _COMPAT_TIME_H */