This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


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

Re: CLK_TCK


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   `------------------------

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