Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Aug 2002 13:51:06 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Mike Barcroft <mike@FreeBSD.org>
Cc:        cvs-committers@FreeBSD.org, <cvs-all@FreeBSD.org>
Subject:   Re: cvs commit: src/sys/alpha/include ansi.h
Message-ID:  <20020826132641.X1137-100000@gamplex.bde.org>
In-Reply-To: <200208260239.g7Q2d4Yn027243@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 25 Aug 2002, Mike Barcroft wrote:

> mike        2002/08/25 19:39:04 PDT
>
>   Modified files:
>     sys/alpha/include    ansi.h
>   Log:
>   Fix a long-standing bug on alpha:
>     Change _BSD_CLK_TCK_ and _BSD_CLOCKS_PER_SEC_ to match stathz.  This
>     should result in bug for bug compatibility in staticly linked
>     programs and dynamicly linked programs should see an immediate
>     correction.
>
>   Revision  Changes    Path
>   1.33      +2 -2      src/sys/alpha/include/ansi.h

Um, this wasn't actually a bug.  It was just bogus.  _BSD_CLK_TCK_ and
_BSD_CLOCKS_PER_SEC_ may be (and were on alphas) unrelated to any physical
or virtual clock except the virtual clocks related to themselves.  E.g.,
_BSD_CLOCKS_PER_SEC_ is only used to define CLOCKS_PER_SEC, which is only
used by clock(3) to lose resolution by converting microseconds into units
of 1/CLOCKS_PER_SEC seconds and by callers of clock(3) to convert back
to useful units.  stathz just gives a not completely unreasonable value for
these constants because user and system times are determined statistically
with an accuracy that is vaguely related to stathz.

Changing these values at compile time causes binary compatibility problems.

These values should not be compile-time constants, but C99 broke this for
CLOCKS_PER_SEC.  POSIX.1-2001 went the other way and removed the CLK_TCK
constant.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020826132641.X1137-100000>