summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorChristopher N. Hesse2016-09-17 11:29:03 -0500
committerChristopher N. Hesse2017-10-22 15:58:41 -0500
commit684b442b9faaf0c9f4466ceb7ca915f010f3edf2 (patch)
tree1aedc8e860e8a751eded7bd48c4201f737103e43 /base
parent4e2a8e375e8fa24c1dab531cff5143a5674c8bf3 (diff)
downloadplatform-system-core-684b442b9faaf0c9f4466ceb7ca915f010f3edf2.tar.gz
platform-system-core-684b442b9faaf0c9f4466ceb7ca915f010f3edf2.tar.xz
platform-system-core-684b442b9faaf0c9f4466ceb7ca915f010f3edf2.zip
libcutils: Fix thread ID on macOS
macOS 10.12 / Xcode 8 actively prohibit the syscall(2) usage. Change-Id: I91ff16600a76e97d0b9b5db7e8905b969fb3482f
Diffstat (limited to 'base')
-rw-r--r--base/logging.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/base/logging.cpp b/base/logging.cpp
index 6357b4ba7..75078e50e 100644
--- a/base/logging.cpp
+++ b/base/logging.cpp
@@ -80,7 +80,9 @@ static thread_id GetThreadId() {
80#if defined(__BIONIC__) 80#if defined(__BIONIC__)
81 return gettid(); 81 return gettid();
82#elif defined(__APPLE__) 82#elif defined(__APPLE__)
83 return syscall(SYS_thread_selfid); 83 uint64_t tid;
84 pthread_threadid_np(NULL, &tid);
85 return tid;
84#elif defined(__linux__) 86#elif defined(__linux__)
85 return syscall(__NR_gettid); 87 return syscall(__NR_gettid);
86#elif defined(_WIN32) 88#elif defined(_WIN32)