Another crack at implementing a usable GetTid() for Mac OS 10.5...
Change-Id: Ic607bc99fa665e81bbbaea1ea0bd1b35f26196ba
diff --git a/src/utils.cc b/src/utils.cc
index 9a12b93..3751727 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -57,7 +57,9 @@
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);