Clean up some #ifdefs.
Only the Mac doesn't have POSIX clocks. (And it still doesn't, a decade
later.)
glibc gained pthread_setname_np in 2.12.
Only the Mac doesn't have prctl.
Change-Id: I218e409f7e133736e15fb68e8a254cdc5799d667
diff --git a/runtime/thread.cc b/runtime/thread.cc
index d2d5be7..f6c8c3e 100644
--- a/runtime/thread.cc
+++ b/runtime/thread.cc
@@ -592,13 +592,13 @@
}
uint64_t Thread::GetCpuMicroTime() const {
-#if defined(HAVE_POSIX_CLOCKS)
+#if defined(__linux__)
clockid_t cpu_clock_id;
pthread_getcpuclockid(tlsPtr_.pthread_self, &cpu_clock_id);
timespec now;
clock_gettime(cpu_clock_id, &now);
return static_cast<uint64_t>(now.tv_sec) * UINT64_C(1000000) + now.tv_nsec / UINT64_C(1000);
-#else
+#else // __APPLE__
UNIMPLEMENTED(WARNING);
return -1;
#endif