bionic has always had gettid.
dex2oat calls GetTid for every line it outputs via Message, which is why
this showed up so much in strace.
Bug: 17049821
Change-Id: Ib51c7f88410b291692874023902cf43f4b9a9d1c
diff --git a/runtime/utils.cc b/runtime/utils.cc
index b55977b..4c52229 100644
--- a/runtime/utils.cc
+++ b/runtime/utils.cc
@@ -66,8 +66,9 @@
uint64_t owner;
CHECK_PTHREAD_CALL(pthread_threadid_np, (NULL, &owner), __FUNCTION__); // Requires Mac OS 10.6
return owner;
+#elif defined(__BIONIC__)
+ return gettid();
#else
- // Neither bionic nor glibc exposes gettid(2).
return syscall(__NR_gettid);
#endif
}