[Top][All Lists]

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

Re: $SECONDS and timeout values use realtime `gettimeofday()`

From: Chet Ramey
Subject: Re: $SECONDS and timeout values use realtime `gettimeofday()`
Date: Fri, 24 Mar 2023 14:41:50 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.8.0

On 3/23/23 8:42 PM, William Kennington via Bug reports for the GNU Bourne Again SHell wrote:
We have systems that start off with inaccurate clocks and at some point
after the boot process synchronize with the network and jump forward in
time. This has the potential to break any scripts that are sitting in
loops, calculating a timeout based on the $SECONDS variable. The current
behavior using realtime instead of monotime is surprising to us.

So the system jumps forward in time at some random point, after the shell
script has started and $SECONDS has been initialized. You're worried that
these scripts will hit their timeout too quickly?

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

reply via email to

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