zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@zsh.org>
To: Zsh hackers list <zsh-workers@zsh.org>,
	Stephane Chazelas <stephane@chazelas.org>
Subject: Re: [PATCHv1] [long] improvements to limit/ulimit API and doc
Date: Thu, 26 Nov 2020 00:43:33 +0100	[thread overview]
Message-ID: <74327-1606347813.918593@HxCz.NV4p.AwzH> (raw)
In-Reply-To: <20201123214942.hi2rx7n3jk25ucmd@chazelas.org>

Stephane Chazelas wrote:
> - I've only tested it on Ubuntu, FreeBSD and Cygwin. I suspect
>   my test cases will fail on 32bit systems. They're skipped on

I tried building and running tests on Solaris 11 and a 32bit build on
Solaris 10. I also checked OpenBSD, NetBSD and Dragonfly. There were
quite a few other issues but nothing introduced by your patch and
your tests passed. Let me know if there's anything additionally that
it'd be useful for me to test manually.

I've got a few comments, mostly on the documentation.

> -If no var(resource) is given, print all limits.
> +If tt(-s) is given without other arguments, the resource limits of the
> +current shell is set to the previously set resource limits of the

s/is/are/

> +sitem(tt(rt_priority))(Maximum realtime priority.)
> +sitem(tt(rt_time))(Maximum realtime CPU time slice.)

From the tcsh manual, these appear to be called maxrtprio and maxrttime
there. But we already had these names, right? Similarly tcsh has
posixlocks.

> -var(limit) is a number, with an optional scaling factor, as follows:
> +If var(limit) is a decimal integer number without suffix, then for
> +historical reason and compatibility with csh where that command comes from,

s/reason/reasons/
Or perhaps just drop the first three words of that line.

> +the unit will depend on the type of limit: microsecond for tt(rt_time),
> +second for all other time limits, kibibytes (1024 bytes) for all limits that

"microseconds" and "seconds" - units are mostly always plural.

> +The same suffixes are recognised as for tt(limit), but bear in mind that
> +default units when no suffix is specified varry between the two.

s/varry/vary/

> +performed with kibibytes, mebibytes, or blocks (of 512 bytes; catch: not
> +em(pebibytes)) instead. (On some systems additional specifiers are available

Not sure about the use of "catch:" there. I'd likely apply emphasis to
not instead

> +The `limit` builtin accepts more units for resource limits, now shared
> +with the `ulimit` builtin allowing to specify arbitrary limit values.

"allowing to" isn't correct unless you add an object for the verb "allow"
such as "you". It might be better to reword it in the passive tense ("to
be specified").

> +`limit -s somelimit` now reports the shell process' own value of the limit.
> +The `limit` and `unlimit` builtins are now available again in csh emulation.
> +More generally, the resouce limit handling interfaces and documentation have

"resource".
"More generally" doesn't really add anything useful to the sentence.

> +++ b/Src/Builtins/rlimits.c
> @@ -55,7 +55,8 @@ typedef struct resinfo_T {
>   * 1. Add zsh_LIMIT_PRESENT(RLIMIT_XXX) in configure.ac.
>   * 2. Add an entry for RLIMIT_XXX to known_resources[].
>   *    Make sure the option letter (resinto_T.opt) is unique.
> - * 3. Build zsh and run the test B12rlimit.ztst.
> + * 3. Add entry in documentation for the limit and ulimit builtins
> + * 4. Build zsh and run the test B12rlimit.ztst.

5. Update Completion/Zsh/Command/_ulimit

Units were often fairly well documented there but are missing in a
couple of cases so you may be able to add a couple.

>  0:check if limit option letters are unique
> 
> +  if sh -c 'ulimit 2048' > /dev/null 2>&1; then

This doesn't work on Solaris or any of the BSDs except FreeBSD - you
have to specify -f to limit file sizes. So it would be skipped despite
the fact that the test could otherwise work.
Isn't -f fairly standard?

From my testing of the changes, it definitely looks like a nice improvement.

Oliver



  parent reply	other threads:[~2020-11-25 23:43 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-23 21:49 Stephane Chazelas
2020-11-25  0:35 ` Daniel Shahaf
2020-11-25  6:44   ` Stephane Chazelas
2020-11-27 17:16     ` Daniel Shahaf
2020-11-26  6:57   ` [PATCHv2 1/2] [long] improvements to limit/ulimit API and doc ((un)limit in csh emulation) Stephane Chazelas
2020-11-25 23:43 ` Oliver Kiddle [this message]
2020-11-26 20:14   ` [PATCH] ulimit option completions using ulimit -a output Stephane Chazelas
2020-11-27  7:13     ` Stephane Chazelas
2020-11-27  8:15       ` Felipe Contreras
2020-11-27 12:19       ` Oliver Kiddle
2021-03-27 21:25         ` Lawrence Velázquez
2021-04-03 14:57           ` Lawrence Velázquez
2021-04-10 20:11             ` Lawrence Velázquez
2021-04-13 14:35     ` Daniel Shahaf
2021-05-09 20:37       ` Lawrence Velázquez
2021-05-11 19:05         ` Stephane Chazelas
2020-11-26 20:58   ` [PATCHv2 2/2] [long] improvements to limit/ulimit API and doc (the rest) Stephane Chazelas
2020-11-27 16:39     ` Daniel Shahaf
2020-11-27 20:13       ` Stephane Chazelas
2020-11-27 20:36         ` Daniel Shahaf
2020-11-28  6:52           ` zsh coding style (was about a limit patch review) Stephane Chazelas
2020-12-01 16:47             ` Daniel Shahaf
2020-11-28  8:16         ` [PATCHv3 2/2] [long] improvements to limit/ulimit API and doc (the rest) Stephane Chazelas
2021-03-27 21:21           ` Lawrence Velázquez
2021-03-31 18:06             ` Stephane Chazelas
2020-11-26 11:19 ` [PATCHv1] [long] improvements to limit/ulimit API and doc Jun T
2020-11-26 13:55   ` Stephane Chazelas
2020-11-26 15:22     ` Jun. T
2020-11-26 17:23       ` Stephane Chazelas
2020-11-27 18:24         ` Jun. T
2020-11-27 18:34           ` Daniel Shahaf
2020-11-27 20:46           ` Stephane Chazelas

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=74327-1606347813.918593@HxCz.NV4p.AwzH \
    --to=opk@zsh.org \
    --cc=stephane@chazelas.org \
    --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).