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

From: Peter Chubb (
Date: Sun Dec 08 2002 - 21:47:10 EST

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

Rik> On Fri, 6 Dec 2002, Rusty Trivial Russell wrote:
>> > Just try "ulimit -H -m 10000" for memory limits that were not >
>> previously set. You end up with (hard limit = 10000) < (soft limit
>> = > unlimited).

>> + if (new_rlim.rlim_cur > new_rlim.rlim_max) + return -EINVAL;

Rik> Wouldn't it be better to simply take the soft limit down to
Rik> min(new_rlim.rlim_cur, new_rlim.rlim_max) ?
Single unix spec says to return EINVAL in this case.

An invalid resource was specified; or in a setrlimit() call, the new
rlim_cur exceeds the new rlim_max.

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:13 EST