bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 0/1] xnanosleep: Use pause for infinite duration.


From: Paul Eggert
Subject: Re: [PATCH 0/1] xnanosleep: Use pause for infinite duration.
Date: Sun, 16 Feb 2020 12:55:47 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

On 2/10/20 4:26 AM, Vladimir Panteleev wrote:

I'm not sure if isfinite is the best way to check for infinity, as far
as the tradeoff between portability and dependencies goes.

We can use the same test that dtotimespec uses, since we want to sleep forever not only if the argument is infinity, but also if it exceeds the maximum possible timespec value. So there's no need for the isfinite portability baggage.

By the way, shouldn't xnanosleep be using the second nanosleep
parameter to track how much time there's left to sleep in case of an
interruption?

I vaguely recall not doing that because some old kernels messed up when setting the time remaining. They're long obsolete now, so it's probably not worth worrying about. If I'm wrong and it is an issue it should be fixed in the nanosleep module anyway.

I installed the attached, which is a bit more conservative than your suggestion, as it doesn't assume that 'pause' exists or that it indeed sleeps forever (though I know of no counterexamples, there's little difficulty in relaxing those assumptions). Thanks for the bug report.

Attachment: 0001-xnanosleep-prefer-pause-and-get-remaining-time.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]