mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-22 04:03:11 +00:00
Add configure check for gettid() presence
The gettid() function is available on Linux in glibc only since version 2.30. There are supported distributions that still use older glibc version. Thus add a configure check if the gettid() function is available and extend the check in src/prof_stack_range.c so it's skipped also when gettid() isn't available. Fixes: https://github.com/jemalloc/jemalloc/issues/2740
This commit is contained in:
@@ -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 <unistd.h>
|
||||
], [
|
||||
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])
|
||||
|
||||
Reference in New Issue
Block a user