This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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_

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]