Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [BUG] zsystem:34: flock: invalid timeout value: '0'



>> 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