This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: CLK_TCK
- To: Andreas Jaeger <aj at suse dot de>
- Subject: Re: CLK_TCK
- From: Ulrich Drepper <drepper at redhat dot com>
- Date: 06 Feb 2001 09:17:50 -0800
- Cc: libc-alpha at sources dot redhat dot com, ro at suse dot de
- References: <hopugvap42.fsf@gee.suse.de>
- Reply-To: drepper at cygnus dot com (Ulrich Drepper)
Andreas Jaeger <aj@suse.de> writes:
> sysdeps/unix/sysv/linux/i386/bits/time.h uses:
>
> # if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K
> /* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
> presents the real value for clock ticks per second for the system. */
> # include <bits/types.h>
> extern long int __sysconf (int);
> # define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */
> # endif
>
> and time/time.h has:
> # if defined __USE_POSIX && !defined __USE_XOPEN2K
> # ifndef CLK_TCK
> # define CLK_TCK CLOCKS_PER_SEC
> # endif
> # endif
>
> Why do we have both definitions?
Not all <bits/time.h> files define CLK_TCK.
> With -D_GNU_SOURCE you don't get any at all since _GNU_SOURCE implies
> __USE_XOPEN2K:
And this is fine. CLK_TCK shouldn't be used. It has been removed
from the standard.
--
---------------. ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Red Hat `--' drepper at redhat.com `------------------------