OSDN Git Service

libc: clean up ARM64 copyright notices
[android-x86/bionic.git] / libc / bionic / pthread_getcpuclockid.cpp
index dbfb7d4..f641e4c 100644 (file)
@@ -31,8 +31,8 @@
 #include "pthread_internal.h"
 
 int pthread_getcpuclockid(pthread_t t, clockid_t* clockid) {
-  pid_t tid = reinterpret_cast<pthread_internal_t*>(t)->tid;
-  if (tid == 0) return ESRCH;
+  pid_t tid = pthread_gettid_np(t);
+  if (tid == -1) return ESRCH;
 
   // The tid is stored in the top bits, but negated.
   clockid_t result = ~static_cast<clockid_t>(tid) << 3;