From ea200e38bd79723054c7ad97cbf87911eac5b7f5 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 8 Jun 2013 11:36:41 -0400 Subject: support cputime clocks for processes/threads other than self apparently these features have been in Linux for a while now, so it makes sense to support them. the bit twiddling seems utterly illogical and wasteful, especially the negation, but that's how the kernel folks chose to encode pids/tids into the clock id. --- src/thread/pthread_getcpuclockid.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/thread/pthread_getcpuclockid.c') diff --git a/src/thread/pthread_getcpuclockid.c b/src/thread/pthread_getcpuclockid.c index cf3d2b84..9df14fb6 100644 --- a/src/thread/pthread_getcpuclockid.c +++ b/src/thread/pthread_getcpuclockid.c @@ -2,5 +2,6 @@ int pthread_getcpuclockid(pthread_t t, clockid_t *clockid) { - return ENOSYS; + *clockid = (-t->tid-1)*8U + 6; + return 0; } -- cgit v1.2.1