On Tue, Jun 11, 2013 at 03:55:46PM -0700, Roland McGrath wrote: > > The /proc file system is merely an example. Also, it's not internal to > > libc, since it gets exported through sysconf(_SC_CLK_TCK). > > You'll have to explain what problem you think there is more thoroughly.
Basically, top doesn't report correct CPU times. This is caused by sysconf() returning 1000000 while values read from /proc are true tick counts, hence 100 per second at most. This discrepancy can be solved either by making /proc scale its values, or making libc return the actual number of ticks per second. I personally think the latter is better for clarity, and also to limit overflows for long running processes, although that's really secondary. -- Richard Braun