cvs commit: src/sys/sys time.h src/sys/kern kern_time.c

Bruce Evans bde at zeta.org.au
Tue Nov 29 04:05:44 GMT 2005


On Mon, 28 Nov 2005, [iso-8859-1] Dag-Erling Smørgrav wrote:

> Bruce Evans <bde at zeta.org.au> writes:
>> I can see a use for making a timestamp after select() returns, not for
>> timeout purposes since the timeout should normally be for emergencies and
>> it's relative so it doesn't need the current time, but just to record when
>> things happen.
>
> IIRC, POSIX allows (but does not require) select(2) to modify the
> provided struct timeval to reflect how much time remains until the
> original deadline.  Personally, I would find that very useful...

This would be hard to use because it is unportable.  IIRC, Linux did or
does this and found mainly bugs with broken applications expecting the
timeval to be const.

Even with this, applications would still need to know when select() was
called to recover the time when it returned.  Adding deltas from select()
to a previous timestamp wouldn't work very well the relative error in
the deltas is large for small deltas (unless you pessimize select() to
get a precise timestamp).

Bruce


More information about the cvs-src mailing list