Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] find RLIM_NLIMITS correctly on Cygwin
Jun T wrote on Mon, 23 Mar 2020 14:31 +0900:
> reply 1/2 to workers/45590
> > 2020/03/21 4:18, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> >
> > Continuing my review:
> >
> > Jun T wrote on Tue, 25 Feb 2020 18:38 +0900:
> >>
> >> -END {
> >> - if (limrev["MEMLOCK"] != "") {
> >> - irss = limrev["RSS"]
> >> - msg[irss] = "Mmemoryuse"
> >> - }
> >
> > Question. I compared the output before and after the patch and I see
> > the following difference:
> >
> > % diff -U0 =(zsh-5.7.1 -fc 'limit') =(limit)
> > --- /tmp/zshZXxkUD 2020-03-20 18:00:04.239999929 +0000
> > +++ /tmp/zshxTTscg 2020-03-20 18:00:04.239999929 +0000
> > @@ -6 +6 @@
> > -memoryuse unlimited
> > +resident unlimited
> > zsh: exit 1 diff -U0 =(zsh-5.7.1 -fc 'limit') =(limit)
> >
> > It seems to be caused by the C implementation not having an equivalent
> > of the above piece of code. this difference intentional?
>
> Sorry, I just lazily ignored that part of rlimits.awk because:
> I didn't understand why existence of RLIMIT_MEMLOCK affects the name
> of RLIMIT_RSS, and,
> on Linux ulimit prints it as "resident set size", and,
> RLIMIT_RSS is used only in kernel 2.4.29 or earlier (on Linux).
>
> # bash's builtin ulimit prints it as "max memory size" on Linux.
>
> If compatibility with the previous version of zsh is important
> we may use the patch below.
I don't know what the rationale/purpose of that awk snippet was, so
I'll leave this to your judgement. (The awk check has been there since
before the first git revision.)
> zshbuiltin man page also needs be updated. Do we need to list all the
> known resources? Or just list most common resources and mention that,
> for example, exact list of resources supported on your system can
> be shown by running 'limit' or 'ulimit -a'?
I'd vote for the latter.
Cheers,
Daniel
> +++ b/Src/Builtins/rlimits.c
> @@ -65,18 +65,23 @@ static const resinfo_T known_resources[] = {
Messages sorted by:
Reverse Date,
Date,
Thread,
Author