Files
semi-libc/src/thread/pthread_getcpuclockid.c
T
Rich Felker ea200e38bd 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.
2013-06-08 11:36:41 -04:00

8 lines
133 B
C

#include "pthread_impl.h"
int pthread_getcpuclockid(pthread_t t, clockid_t *clockid)
{
*clockid = (-t->tid-1)*8U + 6;
return 0;
}