diff options
author | Hao Chen <chenhaosjtuacm@google.com> | 2023-07-18 18:46:34 +0000 |
---|---|---|
committer | Hao Chen <chenhaosjtuacm@google.com> | 2023-07-18 19:52:19 +0000 |
commit | 253445ce3ad507f41c61ebf0f829f75ee2c37509 (patch) | |
tree | e5065d268b1c8f1f009192cfbc9ef2692aa8a5b7 /libcutils | |
parent | 38b572c9e5ead951abfc36bce559077826ab0d8d (diff) | |
download | core-253445ce3ad507f41c61ebf0f829f75ee2c37509.tar.gz |
threads.h: avoid defining gettid on glibc >= 2.30
The issue in https://bugs.chromium.org/p/chromium/issues/detail?id=1182060 also
exists on glibc 2.30 and 2.31 since `gettid` was Introduced in glibc 2.30.
See https://man7.org/linux/man-pages/man2/gettid.2.html
Bug: 285204695
Test: Build
Change-Id: I7e534edf8c0a20c415232bcfffabbf2c1d6eec98
Diffstat (limited to 'libcutils')
-rw-r--r-- | libcutils/include/cutils/threads.h | 2 | ||||
-rw-r--r-- | libcutils/threads.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/libcutils/include/cutils/threads.h b/libcutils/include/cutils/threads.h index 0082c6c63..18861840e 100644 --- a/libcutils/include/cutils/threads.h +++ b/libcutils/include/cutils/threads.h @@ -31,7 +31,7 @@ extern "C" { // // Deprecated: use android::base::GetThreadId instead, which doesn't truncate on Mac/Windows. // -#if !defined(__GLIBC__) || __GLIBC__ >= 2 && __GLIBC_MINOR__ < 32 +#if !defined(__GLIBC__) || __GLIBC__ >= 2 && __GLIBC_MINOR__ < 30 extern pid_t gettid(); #endif diff --git a/libcutils/threads.cpp b/libcutils/threads.cpp index 6ece7a3af..263872084 100644 --- a/libcutils/threads.cpp +++ b/libcutils/threads.cpp @@ -25,9 +25,9 @@ #include <windows.h> #endif -#if defined(__BIONIC__) || defined(__GLIBC__) && __GLIBC_MINOR__ >= 32 +#if defined(__BIONIC__) || defined(__GLIBC__) && __GLIBC_MINOR__ >= 30 // No definition needed for Android because we'll just pick up bionic's copy. -// No definition needed for Glibc >= 2.32 because it exposes its own copy. +// No definition needed for Glibc >= 2.30 because it exposes its own copy. #else pid_t gettid() { #if defined(__APPLE__) |