Subject: Re: sysctl (was usr.sbin/route6d, or sbin/route6d)
To: Simon Burge <simonb@netbsd.org>
From: None <itojun@iijlab.net>
List: tech-net
Date: 01/11/2000 00:33:52
>> > - I think we really need to move sysctl into /sbin. are you guys
>> > happy with it?
>> just a list of facts:
>> /sbin/sysctl: openbsd-current freebsd(all) bsdi41
>> /usr/sbin/sysctl: netbsd(all) openbsd26
>What would be really nice is to have the sysctls looked up by
>the kernel. This way sysctl(8) doesn't grow, and doesn't need
>to be recompiled when a new sysctl is added. Doesn't FreeBSD
>do something like this? A _quick_ scan through the archives
>doesn't reveal any recent discussion on this...
freebsd camp is using linker hack for them.
for example,
- in sys/netinet/ip_icmp.c, declare leaf node as:
SYSCTL_INT(_net_inet_icmp, OID_AUTO, log_redirect, CTLFLAG_RW,
&log_redirect, 0, "");
- it will put certain symbol into the kernel, like:
>c025c60c r __set_sysctl__net_inet_icmp_sym_sysctl___net_inet_icmp_log_redirect
- sys/sysctl.h has #define SYSCTL_INT() foobaa.
Though I think I like the idea of having sysctl table definition in
single place, I hate the way it is implemented in freebsd (if
you forget to include sys/sysctl.h you will be in trouble which is
VERY hard to track down). I prefer the current netbsd way than
freebsd way.
itojun