Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG] zsystem:34: flock: invalid timeout value: '0'
- X-seq: zsh-workers 46151
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: [BUG] zsystem:34: flock: invalid timeout value: '0'
- Date: Sat, 27 Jun 2020 20:09:44 +0200
- Cc: Cedric Ware <cedric.ware__bml@xxxxxxxxxxxxxx>, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>, Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- In-reply-to: <CAH+w=7axxzO1ZuQ7MLjesXMA88pM0-0Lai2kPXUKhs6e7dy3NQ@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVAm3Wp9Gme42qNQeLo=QE8A2ZvcjcyQqw=aRQa2UDNX0w@mail.gmail.com> <20200626141644.7cb5e511@tarpaulin.shahaf.local2> <CAKc7PVCtHg1Pq1qBWBUwdiNe_8w9LXS_3t-2eBSuCg-ZoZnUgw@mail.gmail.com> <20200627014717.68986199@tarpaulin.shahaf.local2> <CAH+w=7YuMOOSbsgop53ZpCGQZ=COGBSS_nMAyS7m6aQ_YmpukA@mail.gmail.com> <20200627071350.zqkdhzbk3mfej2tz@phare.normalesup.org> <CAN=4vMpFpaQg03JbY_B3ktXAEmiUhXH4crdwyc1Ups8Cf=nf8A@mail.gmail.com> <CAH+w=7Zu0Xp2aW-7DTTvF8Ni_eSECzaWW4P=jgpPDNOT942v0g@mail.gmail.com> <CAN=4vMo61Q0unbW6EMJAGmu3k-bUtzvdNWKgfvxAJQ4D-FxDaA@mail.gmail.com> <CAH+w=7axxzO1ZuQ7MLjesXMA88pM0-0Lai2kPXUKhs6e7dy3NQ@mail.gmail.com>
- Sender: zsh-workers@xxxxxxx
>> On Sat, Jun 27, 2020 at 7:01 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> No, that's not it. I just meant that the interval is ultimately implemented by calling nanosleep(), and I strongly suspect that nanosleep() rounds up.
I'm sure it does.
My point is that flock in zsh must not reject timeouts between 0 and 1
microseconds. The right thing to do when a timeout falls between two
steps of granularity is to round up. When converting any kind of
floating point timeout/deadline to integers, it's also necessary to
round up, never down.
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author