diff options
author | Christopher N. Hesse <raymanfx@gmail.com> | 2016-09-17 18:29:03 +0200 |
---|---|---|
committer | Christopher N. Hesse <raymanfx@gmail.com> | 2017-10-22 22:58:41 +0200 |
commit | 684b442b9faaf0c9f4466ceb7ca915f010f3edf2 (patch) | |
tree | 1aedc8e860e8a751eded7bd48c4201f737103e43 /base | |
parent | 4e2a8e375e8fa24c1dab531cff5143a5674c8bf3 (diff) | |
download | core-684b442b9faaf0c9f4466ceb7ca915f010f3edf2.tar.gz core-684b442b9faaf0c9f4466ceb7ca915f010f3edf2.tar.bz2 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.cpp | 4 |
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() { #if defined(__BIONIC__) return gettid(); #elif defined(__APPLE__) - return syscall(SYS_thread_selfid); + uint64_t tid; + pthread_threadid_np(NULL, &tid); + return tid; #elif defined(__linux__) return syscall(__NR_gettid); #elif defined(_WIN32) |