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.