From: Michael Jeanson Date: Mon, 19 Apr 2021 14:53:05 +0000 (-0400) Subject: Add glibc gettid to wrapper X-Git-Tag: v2.13.0-rc1~81 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=4f86e0d0b5debc0d9c56fe9ac76b27b6a215fa4c;p=lttng-ust.git Add glibc gettid to wrapper Change-Id: I706df1c63f49998336c4432575bc1fd31b91b91c Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- 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)