summaryrefslogtreecommitdiff
path: root/libpthread/nptl/sysdeps/unix
diff options
context:
space:
mode:
Diffstat (limited to 'libpthread/nptl/sysdeps/unix')
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/pthread_getcpuclockid.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_getcpuclockid.c b/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_getcpuclockid.c
index ca3570f5f..f4ed2dc7e 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_getcpuclockid.c
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_getcpuclockid.c
@@ -20,6 +20,8 @@
#include <sys/time.h>
#include <tls.h>
+#define CPUCLOCK_PERTHREAD_MASK 4
+#define CPUCLOCK_SCHED 2
int
pthread_getcpuclockid (
@@ -46,7 +48,8 @@ pthread_getcpuclockid (
return ERANGE;
/* Store the number. */
- *clockid = CLOCK_THREAD_CPUTIME_ID | (pd->tid << CLOCK_IDFIELD_SIZE);
+ *clockid = ((~(clockid_t) (pd->tid)) << CLOCK_IDFIELD_SIZE)
+ | CPUCLOCK_SCHED | CPUCLOCK_PERTHREAD_MASK;
return 0;
#else