about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/bits
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-01-06 04:59:13 -0800
committerH.J. Lu <hjl.tools@gmail.com>2015-01-06 04:59:13 -0800
commit57ada0e7e79b9421a77d2b92dffce0f9e8e087b5 (patch)
tree194bb1f4abee3c29299c52ae825f6be8f356c43f /sysdeps/unix/sysv/linux/bits
parent46abb64d6287d09100b147d062f6810066389b7e (diff)
downloadglibc-57ada0e7e79b9421a77d2b92dffce0f9e8e087b5.tar.gz
glibc-57ada0e7e79b9421a77d2b92dffce0f9e8e087b5.tar.xz
glibc-57ada0e7e79b9421a77d2b92dffce0f9e8e087b5.zip
Define CLOCKS_PER_SEC type to the type clock_t
C99 specifies that CLOCKS_PER_SEC is an expression with the type clock_t.
This patch adds a generic <bits/time2.h> to define CLOCKS_PER_SEC and
provides the Linux/x86-64 version of <bits/time2.h> to support x32.

	[BZ #17797]
	* bits/time.h (CLOCKS_PER_SEC): Changed to ((clock_t) 1000000).
	* sysdeps/unix/sysv/linux/bits/time.h (CLOCKS_PER_SEC): Likewise.
	* sysdeps/unix/sysv/linux/clock.c (clock): _Static_assert
	CLOCKS_PER_SEC == 1000000.
	* time/clocktest.c (main): Replace %ld with %jd and cast to
	intmax_t.
Diffstat (limited to 'sysdeps/unix/sysv/linux/bits')
-rw-r--r--sysdeps/unix/sysv/linux/bits/time.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/sysdeps/unix/sysv/linux/bits/time.h b/sysdeps/unix/sysv/linux/bits/time.h
index 226d6dd64f..706946ce22 100644
--- a/sysdeps/unix/sysv/linux/bits/time.h
+++ b/sysdeps/unix/sysv/linux/bits/time.h
@@ -39,13 +39,13 @@ struct timeval
 # ifndef _BITS_TIME_H
 #  define _BITS_TIME_H	1
 
-/* ISO/IEC 9899:1990 7.12.1: <time.h>
-   The macro `CLOCKS_PER_SEC' is the number per second of the value
-   returned by the `clock' function. */
+/* ISO/IEC 9899:1999 7.23.1: Components of time
+   The macro `CLOCKS_PER_SEC' is an expression with type `clock_t' that is
+   the number per second of the value returned by the `clock' function.  */
 /* CAE XSH, Issue 4, Version 2: <time.h>
    The value of CLOCKS_PER_SEC is required to be 1 million on all
    XSI-conformant systems. */
-#  define CLOCKS_PER_SEC  1000000l
+#  define CLOCKS_PER_SEC  ((clock_t) 1000000)
 
 #  if (!defined __STRICT_ANSI__ || defined __USE_POSIX) \
    && !defined __USE_XOPEN2K