diff --git a/configure.ac b/configure.ac index a330e33e..e5fb3a6d 100644 --- a/configure.ac +++ b/configure.ac @@ -2706,6 +2706,15 @@ if test "x${je_cv_pthread_mutex_adaptive_np}" = "xyes" ; then AC_DEFINE([JEMALLOC_HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], [ ], [ ]) fi +JE_COMPILABLE([gettid], [ +#include +], [ + int tid = gettid(); +], [je_cv_gettid]) +if test "x${je_cv_gettid}" = "xyes" ; then + AC_DEFINE([JEMALLOC_HAVE_GETTID], [ ], [ ]) +fi + JE_CFLAGS_SAVE() JE_CFLAGS_ADD([-D_GNU_SOURCE]) JE_CFLAGS_ADD([-Werror]) diff --git a/src/prof_stack_range.c b/src/prof_stack_range.c index c3458044..1f40dcc5 100644 --- a/src/prof_stack_range.c +++ b/src/prof_stack_range.c @@ -4,7 +4,7 @@ #include "jemalloc/internal/malloc_io.h" #include "jemalloc/internal/prof_sys.h" -#if defined (__linux__) +#if defined (__linux__) && defined(JE_HAVE_GETTID) #include #include