[Toybox] [PATCH] ulimit: actually use the units we claim.

enh enh at google.com
Wed May 10 18:11:41 PDT 2023


It's my fault that toybox ulimit claim units but doesn't use them; I
added them to match bash without noticing that the kernel always uses
bytes. I'm assuming we want to resolve that in favor of actually honoring
the units, and removing that from the known differences from bash, but I
don't have a strong opinion (other than that we should be
self-consistent).

One thing that's awkward now is that `ulimit -s 16m` used to do what
you'd expect, but now gives you 1024 times that. Given a clean slate,
I'd say "bytes are obviously the right choice for input, and toybox
already transparently lets you choose your own multipliers". But it
seems odd that `ulimit -s 8192` would mean different things to bash or
toybox sh?

I've added a couple of other existing differences to the list of bash
deviations, but not fixed them in this patch because the obvious fix would
make the diff unreadable (and because I only noticed those differences
playing around on the command line to test this --- no-one else has
noticed yet, that I know).
---
 toys/posix/ulimit.c | 62 +++++++++++++++++++++++++++------------------
 1 file changed, 38 insertions(+), 24 deletions(-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20230510/b02654bb/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ulimit-actually-use-the-units-we-claim.patch
Type: text/x-patch
Size: 5783 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20230510/b02654bb/attachment.bin>


More information about the Toybox mailing list