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

Rob Landley rob at landley.net
Wed May 17 01:51:23 PDT 2023


On 5/15/23 12:55, enh wrote:
>     6) Maybe add -B to ulimit for "bytes" and poke Chet. :)
> 
> i'd be curious to hear his opinions on things like "8m" anyway. just knowing
> that toybox pretty much always accepts that is for me one of the things i like
> most about the toybox implementations of things. i love bytes for
> machine-machine communication, and i hate _implicit_ scaling, but i love being
> able to just throw in a k/m/g wherever...

I keep getting hung up on getting the case wrong with debian's "dd bs=4m" and it
barfs and I have to capitalize the M.

The step beyond being liberal in what you accept and restrictive in what you
emit is sometimes it's better to be consistent than correct.

Rob

(Also, ANOTHER reason I hate "maybebytes" is for debian's dd, M=1024*1024 and
MB=1000*1000 so they added B to mean "decimal". Toybox's number parsing is just
always binary unless you add "d" to any unit, so dd bs=3md is 3000000 bytes.
Dunno if it's right, but it's _consistent_. Coming up with a new name on the
assumption binary is NOT the default is just weird. You still have to say
"decimal megabytes" when you mean decimal megabytes. If they'd gone "kilodytes"
or something equally silly, I would have at least understood that they're
special casing the one that should NOT already be the default...)


More information about the Toybox mailing list