Re: [PATCH 2/2] clock_nanosleep.2, nanosleep.2: Use 'duration' rather than 'request'

Bruno Haible
2024-03-03T13:09:41Z

Alejandro Colomar wrote:
> man2/clock_nanosleep.2 | 20 ++++++++++----------
> man2/nanosleep.2 | 12 ++++++------

The change to nanosleep.2 seems mostly fine. Except that the
term "requested relative duration" (line 142) raises questions;
what about changing that to "requested duration"?

The change to clock_nanosleep.2 seems wrong. There are two cases
(quoting the old text):

If flags is 0, then the value specified in request is interpreted
as an interval relative to the current value of the clock
specified by clockid.

If flags is TIMER_ABSTIME, then request is interpreted as an
absolute time as measured by the clock, clockid. If request is
less than or equal to the current value of the clock, then
clock_nanosleep() returns immediately without suspending the calling
thread.

In the first case, the argument is a duration. In the second case, the
argument is an absolute time point; it would be wrong and very confusing
to denote it as "duration".

Bruno