Subject: Re: Faster pipes, now with uvm_loan()
To: John Hawkinson <jhawk@MIT.EDU>
From: Andy Isaacson <adi@hexapodia.org>
List: tech-kern
Date: 04/30/2001 15:06:48
On Mon, Apr 30, 2001 at 10:51:15AM -0400, John Hawkinson wrote:
> > There is no MI way, but maybe it would be an idea to have a
> > sysctl.clockresolution that user programs could read to get the
> > gettimeofday() resolution.
Should sysconf(_SC_CLK_TCK) be used for this purpose? It's what UNICOS
uses to answer a similar question, and the man page claims it's POSIX
compliant:
The values for name specified by the POSIX P1003.1 standard are listed
in the following with a brief description of the value each returns:
[snip]
_SC_CLK_TCK The number of clock ticks per second.
However, the UNICOS usage is not compatible with the usage being
considered here. On UNICOS, sysconf(_SC_CLK_TCK) returns the resolution
of the hardware clock, which is available via the _rtc() intrinsic
function (the compiler generates the appropriate instructions to read
the hardware clock, something like RDTSC on i386).
> So perhaps a sysctl would be better. If only there were a more convenient
> portable interface...
Hmmm...
-andy