zsh-workers
 help / color / mirror / code / Atom feed
From: "Daniel Shahaf" <d.s@daniel.shahaf.name>
To: "Cedric Ware" <cedric.ware__bml@normalesup.org>
Cc: dana <dana@dana.is>, zsh-workers@zsh.org
Subject: Re: [PATCH] Enable sub-second timeout in zsystem flock
Date: Sun, 15 Mar 2020 19:13:31 +0000	[thread overview]
Message-ID: <0c163473-1349-4377-ac79-917ad8db7aee@www.fastmail.com> (raw)
In-Reply-To: <20200315183616.psa3fhuzsvcmzcga@phare.normalesup.org>

Cedric Ware wrote on Sun, 15 Mar 2020 18:36 +00:00:
> 
> 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?

I think the important part is to display the invalid input.  I don't
immediately see a situation in which I'd run into the input validation
error message and be glad that it spelled out the value of (2**63 / 2e6) for me.

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

Given that we assume zlong is >= 64 bits long, the only way this can be
false is if long is int128_t (or larger) and zlong is int64_t, isn't it?
I don't know of any platform where that'd be true.

Cheers,

Daniel

  reply	other threads:[~2020-03-15 19:14 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-29 20:35 Cedric Ware
2019-07-29 22:25 ` Bart Schaefer
2020-01-04 18:47   ` Cedric Ware
2020-01-05 18:42     ` dana
2020-01-05 21:49       ` dana
2020-01-06 17:30       ` Cedric Ware
2020-01-06 17:36         ` Peter Stephenson
2020-01-07  3:48         ` dana
2020-01-11 15:41           ` Cedric Ware
2020-01-11 19:36             ` dana
2020-01-12  4:25               ` dana
2020-03-08 18:39                 ` Cedric Ware
2020-03-12 18:46                   ` dana
2020-03-12 19:13                     ` dana
2020-03-14 21:04                     ` Cedric Ware
2020-03-15  0:50                       ` Daniel Shahaf
2020-03-15  1:04                         ` dana
2020-03-15 16:03                         ` Cedric Ware
2020-03-15 16:54                           ` Daniel Shahaf
2020-03-15 17:35                             ` Peter Stephenson
2020-03-15 18:36                             ` Cedric Ware
2020-03-15 19:13                               ` Daniel Shahaf [this message]
2020-04-13 21:34                             ` Cedric Ware
2020-04-14 11:47                               ` Daniel Shahaf
2020-04-14 20:21                                 ` Cedric Ware
2020-04-15  1:15                                   ` Daniel Shahaf
2020-04-15  2:05                                     ` dana
2020-04-16  4:24                                       ` Daniel Shahaf
2020-04-18 16:32                                         ` Cedric Ware
2020-04-20 17:28                                           ` dana
2020-04-20 22:17                                             ` Cedric Ware
2020-03-15  1:04                       ` Daniel Shahaf
2020-03-13 14:26                   ` dana

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0c163473-1349-4377-ac79-917ad8db7aee@www.fastmail.com \
    --to=d.s@daniel.shahaf.name \
    --cc=cedric.ware__bml@normalesup.org \
    --cc=dana@dana.is \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).