summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/utils.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/utils.cc b/src/utils.cc
index 9a12b93d18..3751727780 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -57,7 +57,9 @@ pid_t GetTid() {
return syscall(SYS_thread_selfid);
#elif defined(__APPLE__)
// On Mac OS 10.5 (which the build servers are still running) there was nothing usable.
- return getpid();
+ // We know we build 32-bit binaries and that the pthread_t is a pointer that uniquely identifies
+ // the calling thread.
+ return reinterpret_cast<pid_t>(pthread_self());
#else
// Neither bionic nor glibc exposes gettid(2).
return syscall(__NR_gettid);