Re: linux missing support for _POSIX_THREAD_CPUTIME?

From: Chris Friesen
Date: Wed May 27 2009 - 13:15:38 EST

Thomas Gleixner wrote:
> On Wed, 27 May 2009, Chris Friesen wrote:
> That's more a question for the glibc folks. CC'ed.

Actually, I'm looking at the kernel code here. It looks like
posix_cpu_clock_get() should be able to handle a per-task cpu clock for
another thread within the same process. However, it's only ever called
by thread_cpu_clock_get(), which hardcodes a clock_id of THREAD_CLOCK,
which corresponds to the current thread.

Similarly, invalid_clockid() will say that the clock_id is invalid if
it's positive but greater than 15. If my math is right, this means that
any pid > 2 will result in invalid_clockid() failing.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at