|
|
||
|
On 6 Oct 2006, at 09:10, Glenn Maynard wrote:
On Fri, Oct 06, 2006 at 08:52:43AM +0100, David Jones wrote:I've now looked at how lposix _uses_ CLK_TCK. It's used to manipulate the results of the times(3) call. Which, in OS X, is documented as A) obsoleted and B) returning values in CLK_TCK's of a second. But sadly, as I've discovered, CLK_TCK isn't defined on OS X 10.4 so that makes times(3) completely useless.
That's just a documentation glitch, surely; CLK_TCK is the same thing as
sysconf(_SC_CLK_TCK), other than its deprecatedness. My linux times (2)
manpage says:
NOTES The number of clock ticks per second can be obtained using sysconf(_SC_CLK_TCK); In POSIX-1996 the symbol CLK_TCK (defined in <time.h>) is mentioned as obsolescent. It is obsolete now.
A platform-specific documentation error doesn't make the function useless,
especially when the function in question is defined by a standard which,
presumably, doesn't make the same error ...
I'm a great fan of -ansi -pedantic -Wall though.
Don't forget -W, which enables several other useful warnings not included in -Wall.
drj