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

Re: [PATCH] Enable sub-second timeout in zsystem flock



Daniel Shahaf (Sunday 2020-03-15):
> Cedric Ware wrote on Sun, Mar 15, 2020 at 17:03:24 +0100:
> > I think that was about my earlier attempt to include the actual limit
> > in the error message, not the input.  I reverted to a generic message,
> > because I don't know how to make the test script check for an error
> > message that depends on the system/compiler options.
> 
> How would the message depend on the system/compiler options?

Not with your suggestion, which I implemented.  My original idea was
for an error message like "invalid timeout value, maximum is N", where
N would be ZLONG_MAX / 2 / 1000000.  But to display the latter, I'd
have needed a way to output a zlong, which has just now been proposed.
Would it be useful?

> In any case, you might be able to address this by specifying the
> expectations as patterns:

OK, thanks.

> How likely is zsh 5.9 to be ported to a platform that doesn't have a
> 64-bit type?
> 
> If that's a concern, I'd recommend to issue a warning or disable the
> feature when we detect that case.
> 
> I'm not sure whether that's a concern.

Well, neither am I. :-)  Essentially we'd have to keep both the old and
the new code alongside, with an #if sizeof(zlong) < 8 to choose one.
Cumbersome, but it could be done.

> > Still, would you like it better if I limited the interval to
> > min(LONG_MAX, ZLONG_MAX / 2) instead of LONG_MAX?
> 
> Well, it sounds like that won't make any difference to bin_system_flock()'s
> behaviour in practice (at least until someone has servers with uptimes
> on the order of tens of kiloyears), so I don't have a strong preference.
> I suppose I'd recommend whichever of these is more likely to remain
> correct even if the code is copied elsewhere and adapted.

Changing the limit should be easy.  I see there is a macro minimum().
Can I assume that a long can always be promoted to a zlong?

					Thanks, best regards,
					Cedric Ware.



Messages sorted by: Reverse Date, Date, Thread, Author