Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Oct 2007 18:09:09 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        "Constantine A. Murenin" <mureninc@gmail.com>
Cc:        src-committers@freebsd.org, Alexander Leidinger <netchild@freebsd.org>, cvs-src@freebsd.org, cvs-all@freebsd.org, "Constantine A. Murenin" <cnst@freebsd.org>, Poul-Henning Kamp <phk@phk.freebsd.dk>, Wilko Bulte <wb@freebie.xs4all.nl>
Subject:   Re: cvs commit: src/etc Makefile sensorsd.conf src/etc/defaults rc.conf src/etc/rc.d Makefile sensorsd src/lib/libc/gen sysctl.3 src/sbin/sysctl sysctl.8 sysctl.c src/share/man/man5 rc.conf.5 src/share/man/man9 Makefile sensor_attach.9 src/sys/conf f
Message-ID:  <200710161809.10755.jhb@freebsd.org>
In-Reply-To: <f34ca13c0710161446l50deee86k3e6d6605e35a79d6@mail.gmail.com>
References:  <f34ca13c0710161446l50deee86k3e6d6605e35a79d6@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 16 October 2007 05:46:18 pm Constantine A. Murenin wrote:
> On 16/10/2007, John Baldwin <jhb@freebsd.org> wrote:
> > On Tuesday 16 October 2007 12:33:11 pm Alexander Leidinger wrote:
> > > Constantine asked for review several times on -current. He got some
> > > reviews several times for commits to perforce. He incorporated
> > > suggestions from those reviews, or explained why it is like it is and
> > > why he can not switch (with no replies with suggestions how to solve
> > > the problems he sees with the suggestions). Now you come and ask why
> > > nobody pointed out some flaws before (without telling us which
> > > technical flaws you talk about).
> >
> > At least from my point of view this is not quite accurate as pretty much 
all
> > my feedback to the p4 commits was ignored with basically "Well, I don't 
like
> > doing it that way".  Specifically, with regards to creating dynamic sysctl
> > trees, Constantine feels that sysctl_add_oid(9) is a hack rather than
> > recognizing that this is a feature of FreeBSD's sysctl system despite
> > repeated e-mails on the subject.
> 
> Dear John,
> 
> I have specifically addressed this concern of yours just several weeks ago.
> 
> Please see the following message, which you've never replied to:
> 
> http://lists.freebsd.org/pipermail/p4-projects/2007-September/021121.html
> 
> I've used the documented parts of the FreeBSD's sysctl interface to
> preserve 100% userland compatibility with OpenBSD.

FreeBSD already provides an interface for creating dynamic sysctl trees that 
is simpler than having to simulate a pseudo-tree via the .oid_handler 
routine.  In some cases (such as kern.proc) FreeBSD still uses a function 
handler rather than giving each process its own sysctl node.  However, in 
other cases (generally more recent ones, and ones not as large/performance 
impacting) such as dev.* or the recent proposal to give ifnet's their own 
nodes under 'net.if' or the like, sysctl_add_oid(9) is used.

As to the process of walking sysctl trees being undocumented, it is simply 
missing a wrapper routine ala sysctlbyname(3) and a manpage.  You could 
easily provide one and thus provide a facility for enumerating many different 
things than having several one-off oid_handler routines to enumerate 
subtrees.  However, it is not some "backdoor" hack interface anymore than 
sysctlbyname(3) is.  They are both equally hackish or non-hackish (depending 
on your point of view).

> I cannot possibly 
> see why you would have a problem with such an approach other than for
> the fact that OpenBSD is not a proprietary system with wealthy
> sponsors.

I think I'll let that speak for itself.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200710161809.10755.jhb>