This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[PATCH] change CLOCKS_PER_SEC to match POSIX:XSI
- From: Bob Wilson <bwilson at tensilica dot com>
- To: newlib at sources dot redhat dot com
- Date: Thu, 06 Oct 2005 13:19:11 -0700
- Subject: [PATCH] change CLOCKS_PER_SEC to match POSIX:XSI
The XSI extension to POSIX requires that CLOCKS_PER_SEC be defined to one
million. The current value in newlib, except for RTEMS and ARM, is 1000. Since
this value seems pretty arbitrary, wouldn't it be better to go with the POSIX
value? Here is a patch to change it.
2005-10-06 Bob Wilson <bob.wilson@acm.org>
* libc/include/time.h (CLOCKS_PER_SEC): Define to 1000000.
Index: libc/include/time.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/time.h,v
retrieving revision 1.16
diff -u -r1.16 time.h
--- libc/include/time.h 25 Feb 2005 22:31:20 -0000 1.16
+++ libc/include/time.h 6 Oct 2005 20:14:38 -0000
@@ -18,7 +18,7 @@
#include <machine/time.h>
#ifndef _CLOCKS_PER_SEC_
-#define _CLOCKS_PER_SEC_ 1000
+#define _CLOCKS_PER_SEC_ 1000000
#endif
#define CLOCKS_PER_SEC _CLOCKS_PER_SEC_