lkml.org 
[lkml]   [1998]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: sysctl() considered harmful
A. N. Kuznetsov writes:
> 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.

That's what I did for my MTRR driver (/proc/mtrr). It supports an
ASCII interface for the sysadmin and an ioctl() interface for C
programmes (i.e. X server). IMHO this is a better way of doing it.
The ASCII interface can change without breaking C code.

Regards,

Richard....

\
 
 \ /
  Last update: 2005-03-22 13:41    [W:0.523 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site