Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCHv1] [long] improvements to limit/ulimit API and doc

> 2020/11/26 22:55, Stephane Chazelas <stephane@xxxxxxxxxxxx> wrote:
> But:
> $ bash --posix -c 'ulimit 18446744073709551617;  ulimit'
> 1

I think this is a bug of bash.
It seems bash checks the wrap around only for the calculation of
bytes = 512*blocks, and does not check if the number of blocks
is already wrapped around.

> There's also the question of the actual value of RLIM_INFINITY,
> RLIM_SAVED_MAX, RLIM_SAVED_CUR and whether we can assume
> RLIM_INFINITY is the maximum possible value.

I guess zsh need not care about these things.

# I must say I don't know what it means if RLIM_SAVED_XXX is not
# equal to RLIMI_INFINITY.

Zsh only need to check whether the new limit user wants to set is
within the range of rlim_t.

If it is not, then zsh should warn about it instead of passing the
wrap-around value to setrlimit(2).

If it is, then just pass it to setrlimit(2) (need not check whether
it is smaller than RLIM_INFINITY or not).
If setrlimit() returns error, then report it to the user.


Messages sorted by: Reverse Date, Date, Thread, Author