Use native gettid() if available (which is the case on Android).

This commit is contained in:
Tobias Brunner
2012-01-10 18:31:33 +01:00
parent 190cd8a475
commit 66f16d9629
2 changed files with 24 additions and 12 deletions
+13 -9
View File
@@ -380,15 +380,19 @@ dnl check if native rwlocks are available
AC_CHECK_FUNCS(pthread_rwlock_init)
LIBS=$saved_LIBS
AC_MSG_CHECKING([for gettid])
AC_TRY_COMPILE(
[#define _GNU_SOURCE
#include <unistd.h>
#include <sys/syscall.h>],
[int main() {
return syscall(SYS_gettid);}],
[AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_GETTID])],
[AC_MSG_RESULT([no])]
AC_CHECK_FUNC(
[gettid],
[AC_DEFINE(HAVE_GETTID)],
[AC_MSG_CHECKING([for SYS_gettid])
AC_TRY_COMPILE(
[#define _GNU_SOURCE
#include <unistd.h>
#include <sys/syscall.h>],
[int main() {
return syscall(SYS_gettid);}],
[AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_SYS_GETTID])],
[AC_MSG_RESULT([no])]
)]
)
AC_CHECK_FUNCS(prctl mallinfo getpass closefrom)