GNU bug report logs - #77535
timeout treats very short durations as `0`

Previous Next

Package: coreutils;

Reported by: Nicolas Boichat <nicolas <at> boichat.ch>

Date: Fri, 4 Apr 2025 16:13:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #43 received at 77535 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: nicolas <at> boichat.ch, 77535 <at> debbugs.gnu.org
Subject: Re: bug#77535: timeout treats very short durations as `0`
Date: Mon, 7 Apr 2025 18:46:31 +0100
On 07/04/2025 09:08, Paul Eggert wrote:
> On 2025-04-05 13:56, Pádraig Brady wrote:
>> I'm going to apply the attached later to remove the libm dependency.
>> It's just too much of a dependency for minimal functionality.
> 
> Thanks, agreed about the dependency. Still, 'timeout' (and, now that I
> think about it, 'sleep' and 'tail') should always wait for at least the
> time requested.
> 
> After thinking about it I installed the attached further patch, which
> addresses the problem in a different way without needing libm on
> GNU/Linux. Although we could tighten the bounds further in typical cases
> (by using the algorithm 'date' uses to parse seconds, if the string is
> of that form) I tried to keep it simple, as the main point is to not
> sleep for less than the time requested.
> 
> Floating point can be such a pain sometimes, even for simple things.
> (Read the cited paper and see....)

Nice.
I hadn't realized gnulib's signbit avoided the dependency on libm.

thanks!
Pádraig




This bug report was last modified 102 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.