Subject: Re: mib list in sysctl.8
To: None <tech-userlevel@NetBSD.org>
From: David Young <dyoung@pobox.com>
List: tech-userlevel
Date: 12/03/2006 15:42:16
On Sun, Dec 03, 2006 at 10:28:53PM +0100, Pavel Cahyna wrote:
> On Sun, Dec 03, 2006 at 07:10:44PM +0200, Elad Efrat wrote:
> > Pavel Cahyna wrote:
> > 
> > > I've uploaded the proposed manpages to
> > > www.netbsd.org/~pavel/sysctl.{3,7,cat3,cat7}
> > 
> > I would like to point out that because this is not an urgent fix, we
> > should not postpone the removal of the big list from sysctl.8 too;
> > otherwise we still have to update two man-pages instead of one, which
> > was the real purpose of the change.
> 
> Sure, no problem with the removal of the list from sysctl.8 ...
> But I would like to commit this ASAP, if sysctl.3 is updated, it would
> create more work to synchronize the uncommitted sysctl.7 again.
> 
> > also, like I said before, I don't see point in documenting the constants
> > in the new man-page.
> 
> I've thought that too, but then I discovered that it is still needed.
> The reason is that some constants don't have an equivalent text name. E.g.
> the kern.proc, kern.proc_args and kern.ipc.sysvipc_info subtrees, and
> apparently net.route too.
> 
> In some cases one of the intermediate names is a number determined
> dynamically, e.g. under proc the second level name is a PID. In this case,
> it is easier to know the numeric identifiers for all the levels directly
> than to convert the string names with sysctlnametomib().
> 
> OTOH I don't think that having defined numeric constants for newly added
> MIBs and documenting them is a requirement. But keeping the old
> documentation does not do any harm.

Maybe I am missing something, but the importance of the old documentation
is that a kernel programmer needs to know that the numeric path CTL_NET,
PF_INET, IPPROTO_IP, and only that path, is equivalent to net.inet.ip,
just in case they add a new module with a MIB under net.inet.ip.  If their
module's initialization runs before IP, and they do not use the numeric
path, then sysctl_createv(9) may assign arbitrary numbers to "net",
"inet", "ip".  That will cause problems, or so it seems to me.

Dave

-- 
David Young             OJC Technologies
dyoung@ojctech.com      Urbana, IL * (217) 278-3933