[issue1040026] os.times() is bogus
Alexander Belopolsky
report at bugs.python.org
Sat Feb 23 22:15:12 CET 2008
Alexander Belopolsky added the comment:
os_times3.PATCH works for me on Mac OS 10.4 and RHEL. I have a few
comments on the patch:
1. sysconf return type is long, not clock_t
2. If sysconf is present, but _SC_CLK_TCK is not supported, it will
return -1. In this case we should fall back to system HZ if available.
3. Use -1 instead of NULL as the invalid value. NULL has too strong
connotation with pointers.
4. On systems where fixed HZ is correct calling sysconf(_SC_CLK_TCK) on
every times call is an overkill.
I would suggest that instead of patching posixmodule.c an appropriate
system-dependent value for HZ should be defined in configure.h.
Unfortunately I am not familiar enough with autoconf to prepare a patch.
_____________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1040026>
_____________________________________
More information about the Python-bugs-list
mailing list