On Sat, 18 Dec 1999, Peter Wemm wrote:

> Andrzej Bialecki wrote:
> > On Fri, 17 Dec 1999, Arun Sharma wrote:
> > 
> > > I have also figured out how to dynamically register sysctl nodes.
> > > The trick is to basically malloc a sysctl_oid and fill in the right
> > > fields and calling sysctl_register_oid. The code is in a kernel
> > > module available from:
> > > 
> > > http://sharmas.dhs.org/~adsharma/projects/freebsd/sysctl.tar.gz
> > > 
> > > It really needs to go into the base kernel. Also, I think
> > > sysctl_register_long and its yet to be written friends (register_int)
> > > etc, need to go into kern_sysctl - so that others can reuse the code
> > > to dynamically create sysctl nodes.
> > 
> > I was thinking exactly about the same, and I was going to implement them
> > myself... IMO these patches should go to the tree - without them the work
> > that Mike Smith put into sysctl infrastructure is much less useful for
> > average Joe Kernel Hacker...
> 
> Err.. That was Doug Rabson (dfr) who fixed the sysctl stuff to finish
> making it dynamic.  sysctl_register_xxx() are wrappers around
> sysctl_register_oid(), but I guess it's ok to make some helper functions to
> make the existing functionality to make it easier to use.

Oh... My sincere apologies then for wrong attribution.

Anyway, I think this stuff (although it may seem redundant to you) is very
helpful. It takes some time to figure out how to untangle the SYSCTL_*,
SLIST_*, DATA_SET and linker sets (which are not really indispensable
here) to really learn how the dynamic sysctls work. These functions
provide useful and handy shortcuts. IMHO, of course.

Andrzej Bialecki

//  <[EMAIL PROTECTED]> WebGiro AB, Sweden (http://www.webgiro.com)
// -------------------------------------------------------------------
// ------ FreeBSD: The Power to Serve. http://www.freebsd.org --------
// --- Small & Embedded FreeBSD: http://www.freebsd.org/~picobsd/ ----




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to