Re: Add pselect, ppoll system calls.

From: Mattias Engdegård
Date: Tue Jun 14 2005 - 09:09:19 EST


>Monotonic clocks are guaranteed to not go backward. A sudden warp 35
>seconds into the future when you have timers set for 15 and 20
>seconds into the future is still ugly....

I don't have the POSIX specs handy, but I see no reason we could not let
it use a warpless monotonic clock.

The problem of timeouts going wild when time is being warped applies
to syscalls using relative timeouts as well. Even when a relative
timeout is wanted, it is usually transformed (via gettimeofday or
similar) to an absolute timeout:

T = some_clock() + dT
timeout = dT
loop:
poll(..., timeout)
if (poll did not time out):
now = some_clock()
timeout = MAX(0, T - now)
goto loop

This kind of code is very common, because the timeout is usually the
time to some event in the future. If some_clock() is subject to
warping (which is the case when gettimeofday() is used), then you have
the problem again.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/