Revert "Compat layer for gettid"
[lttng-ust.git] / liblttng-ust / lttng-context-vtid.c
index 3fe86405c112307a47e6c1abe0a9c62fe8b2175b..6f7e078d22d2910072748adfd0ee59b8c9a695b4 100644 (file)
 #include <lttng/ust-events.h>
 #include <lttng/ust-tracer.h>
 #include <lttng/ringbuffer-config.h>
-#include <lttng/ust-tid.h>
+
+#ifdef __linux__
+#include <syscall.h>
+#endif
+
+#if defined(_syscall0)
+_syscall0(pid_t, gettid)
+#elif defined(__NR_gettid)
+static inline pid_t gettid(void)
+{
+       return syscall(__NR_gettid);
+}
+#else
+#warning "use pid as tid"
+static inline pid_t gettid(void)
+{
+       return getpid();
+}
+#endif
 
 /*
  * We cache the result to ensure we don't trigger a system call for
This page took 0.023929 seconds and 4 git commands to generate.