Re: sysctl() considered harmful

A.N.Kuznetsov (kuznet@ms2.inr.ac.ru)
Tue, 6 Jan 1998 16:34:27 +0300


In article <199801060047.BAA01590@mira.isdn.cs.tu-berlin.de> you wrote:
: No effort has been taking to give those sysctls which lost their
: meaning during 2.1 some reasonable implementation. Most notably,
: NET_IPV4_FORWARD can probably implemented on top of
: NET_IPV4_FORWARDING. One exception: NET_IPV4_DYNADDR is apparently
: the same as NET_IPV4_IP_DYNADDR.

I'm sorry but the most of 2.1.77 NET_IPV4_* and NET_IPV6_* are obsolete.
So that just imagine, that they do not exist at all :-)
They will stabilize in 2.2 and, apparently, will have nothing
common with 2.0.

Moreover, I believe all the idea behind binary sysctl() is wrong
by design. sysctl() touches bowels of kernel, so that you cannot hope
that a value will be preserved in development or between major releases.

In other word, sysctl() is NOT an API. It is part of kernel.
Otherwise there are no reasons why not to get rid of it at all.
ioctl() is more then enough for this purpose.

BTW I do not understand also why not to do an ioctl(SYSCTL_{R|W}) on
open "/proc/sys/...." if someone dislikes ascii assignments.

Alexey Kuznetsov