From 4f86e0d0b5debc0d9c56fe9ac76b27b6a215fa4c Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Mon, 19 Apr 2021 10:53:05 -0400 Subject: [PATCH] Add glibc gettid to wrapper Change-Id: I706df1c63f49998336c4432575bc1fd31b91b91c Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- configure.ac | 1 + src/common/compat/tid.h | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 66e07f7f..032adea9 100644 --- a/configure.ac +++ b/configure.ac @@ -261,6 +261,7 @@ AC_CHECK_FUNCS([ \ clock_gettime \ ftruncate \ getpagesize \ + gettid \ gettimeofday \ localeconv \ memchr \ diff --git a/src/common/compat/tid.h b/src/common/compat/tid.h index aecae9b1..3d38f976 100644 --- a/src/common/compat/tid.h +++ b/src/common/compat/tid.h @@ -13,7 +13,15 @@ #include #endif -#if defined(__NR_gettid) +#ifdef HAVE_GETTID + +#include +static inline pid_t lttng_gettid(void) +{ + return gettid(); +} + +#elif defined(__NR_gettid) #include static inline pid_t lttng_gettid(void) -- 2.34.1