Re: sysconf (was Re: RLIM_INFINITY inconsistency between archs)

From: Linus Torvalds (torvalds@transmeta.com)
Date: Fri Jul 28 2000 - 16:19:33 EST


On Fri, 28 Jul 2000, Frank van Maarseveen wrote:
>
> > Read my lips: if it doesn't change value during the running of the
> > machine, it should not be a system call.
>
> I would put it the other way around: if it changes (i.e. it's dynamic) then
> there's no point in supplying a system call. In that case any need for a
> max reveals lame programming.

Hmm.

Putting our two statements together, we obviously never need system calls
at all, and I should just stop doing this silly kernel :)

But I agree. As far as sysconf is concerned there are two "system
configuration" cases:
 - doesn't change. No system call necessary, because we might as well set
   it up with the file in /etc/sysconf or whatever.
 - does change. In which case even _asking_ for a maximum is fairly
   suspect, because you cannot depending on it being the "true" maximum.

Note that there may well be per-user limits etc, but as far as the kernel
is concerned those are not sysconf values, they are more akin to ulimit().

And obviously "sysconf()" can ask for ulimit() kind of things if it wants
to. The issue of those kinds of limits is actually fairly interesting, and
Linux could benefit from having more of them (especially of the "per-user"
variety, considering the "use up all the file descriptors" attacks etc).

                Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jul 31 2000 - 21:00:28 EST