diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-02-17 17:46:02 +0100 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-02-17 18:24:17 +0100 |
commit | 88e4058fc4ab8c4215327154f4c32f0652bb3e6b (patch) | |
tree | 3354bebf50d0ce71259d6a9b3ab2fb119b316d5a /configure.ac | |
parent | ca770ae77e38b6a634282e19d7b6e16a28db39f3 (diff) |
Introduce osmo_gettid() API
This API wraps conventional gettid() linux-specific API, which even in
Linux itself is sometimes not properly supported/announced.
This API also allows future porting to other platforms if needed, and so
far falls back to getpid() if no gettid(9 can be found.
Code ported from osmo-trx.git, see commit 7a07de1efd4eb7cc11c33d3ad25cb2df70aa1ef1.
Related: OS#5027
Change-Id: Id7534beeb22fcd50813dab76dd68818e2ff87ec2
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 2a6a1807..f5af0d02 100644 --- a/configure.ac +++ b/configure.ac @@ -134,6 +134,16 @@ AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [ CHECK_TM_INCLUDES_TM_GMTOFF +# Check if gettid is available (despite not being documented in glibc doc, +# it requires __USE_GNU on some systems) +# C compiler is used since __USE_GNU seems to be always defined for g++. +save_CPPFLAGS=$CPPFLAGS +AC_LANG_PUSH(C) +CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" +AC_CHECK_FUNCS([gettid]) +AC_LANG_POP(C) +CPPFLAGS=$save_CPPFLAGS + dnl Check if We need to apply workaround for TLS bug on ARM platform for GCC < 7.3.0: ARG_ENABLE_DETECT_TLS_GCC_ARM_BUG |