bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ulimit -R missing; --help is out of sync


From: Chet Ramey
Subject: Re: ulimit -R missing; --help is out of sync
Date: Fri, 18 Dec 2020 09:51:34 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.5.1

On 12/17/20 5:26 PM, Denys Vlasenko wrote:
According to the source, -R should be setting RLIMIT_RTTIME,
but it does not work:

bash-5.0$ ulimit -R
bash: ulimit: -R: invalid option
ulimit: usage: ulimit [-SHabcdefiklmnpqrstuvxPT] [limit]

There isn't a system out there (well, maybe recent Linux kernels) that
supports all of the possible ulimit options. Bash defines all of the
possible options, corresponding to all of the supported resources, in a
single struct using #ifdef and builds the string of valid options at run
time. There's a comment in the source to this effect.

The short usage synopsis from `help' isn't like that. It's declared at
compile time as a constant string so it can be part of the struct
describing the available builtins. It can't be built at runtime, so it
describes every possible option (and, yes, omitting `R' was an oversight).

Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]