Re: [TRIVIAL] Re: setrlimit incorrectly allows hard limits to exceed soft limits

From: Peter Chubb (
Date: Mon Dec 09 2002 - 14:28:46 EST

>>>>> "Rik" == Rik van Riel <> writes:

Rik> On Mon, 9 Dec 2002, Peter Chubb wrote: Wouldn't it be better to
Rik> simply take the soft limit down to min(new_rlim.rlim_cur,
Rik> new_rlim.rlim_max) ?
>> Single unix spec says to return EINVAL in this case.
>> [EINVAL] An invalid resource was specified; or in a setrlimit()
>> call, the new rlim_cur exceeds the new rlim_max.

Rik> So how about "the old rlim_cur exceeds the new rlim_max" ? ;)

You always have to set both, so the old value is irrelevant, except in
so far as rlim_max may not be increased except by a privileged

setrlimit may return EINVAL if the actual usage is above the new

Dr Peter Chubb
You are lost in a maze of BitKeeper repositories, all almost the same.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Sun Dec 15 2002 - 22:00:15 EST