Another way to do it would be to adjust the max limit up to the soft
limit only if the process had CAP_SYS_RESOURCE, just like in the
function svr4_ulimit in abi/svr4/ulimit.c.
In both cases, however, changing it will mean changing a limit on
behalf of the process. But IMHO wouldn't most applications would
expect rlimits modified with setrlimit successfully to be set to the
rlimits that they specified as the argument? Any child processes they
spawn would expect the same set of modified rlimits to be inherited as
well. If we fix an incorrect pair of rlimits on their behalf, they
would then see different rlimit values with getrlimit later.
In light of that wouldn't it be better just to return an error and
insist that broken applications get fixed? Unless of course there are
just too many broken apps out there : )
-- Kingsley - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/