#include <syscall.h>
#endif
-#if defined(_syscall0)
-_syscall0(pid_t, gettid)
-#elif defined(__NR_gettid)
+#if defined(__NR_gettid)
+
#include <unistd.h>
-static inline pid_t gettid(void)
+static inline pid_t lttng_gettid(void)
{
return syscall(__NR_gettid);
}
+
#else
+
#include <sys/types.h>
#include <unistd.h>
/* Fall-back on getpid for tid if not available. */
-static inline pid_t gettid(void)
+static inline pid_t lttng_gettid(void)
{
return getpid();
}
+
#endif
#endif /* LTTNG_TID_H */
/* Three level of debug. Use -v, -vv or -vvv for the levels */
#define _ERRMSG(msg, type, fmt, args...) __lttng_print(type, msg \
" - %s [%ld/%ld]: " fmt " (in %s() at " __FILE__ ":" XSTR(__LINE__) ")\n", \
- log_add_time(), (long) getpid(), (long) gettid(), ## args, __func__)
+ log_add_time(), (long) getpid(), (long) lttng_gettid(), ## args, __func__)
#define _ERRMSG_NO_LOC(msg, type, fmt, args...) __lttng_print(type, msg \
" - %s [%ld/%ld]: " fmt "\n", \
- log_add_time(), (long) getpid(), (long) gettid(), ## args)
+ log_add_time(), (long) getpid(), (long) lttng_gettid(), ## args)
#define MSG(fmt, args...) \
__lttng_print(PRINT_MSG, fmt "\n", ## args)