Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Dec 1999 11:47:09 +0100
From:      Marcel Moolenaar <marcel@scc.nl>
To:        current@FreeBSD.org
Subject:   Re: Modules and sysctl tree
Message-ID:  <38537D2D.CA2C3DB3@scc.nl>
References:  <199912112149.NAA71033@bubba.whistle.com>, <91986.944949603@zippy.cdrom.com>

next in thread | previous in thread | raw e-mail | index | archive | help
"Jordan K. Hubbard" wrote:
> 
> > In other words, it's not a problem specific to KLD's ..  but
> > it's still a problem :-)
> 
> Which raises an important issue - other than walking the sysctl tree
> regularly looking for changes, how does such an application become
> aware that the sysctl space has changed?  The same holds true for a
> dynamic /dev, of course, though one assumes one can at least hack a
> solution with devfs where you stat the directory and compare its
> current mod time with a saved one, only walking the directory if you
> see a change.  I don't see any kind of mechanism for doing this
> with sysctl, even as a gross hack.

It crossed my mind when implementing Linuxulator sysctl variables. IIRC,
I though that it might be a good idea to have a `kern.modules' tree that
holds which modules are loaded (either dynamicly or staticly). Since
each sysctl variable belongs to a module (be it the kernel core),
walking the `kern.modules' tree is sufficient to detect changes in the
rest of the sysctl tree.

It can also used as an alternative to find out if module foobar is
loaded, for example.

An alternative to this is to only add modules to kern.modules if it
changes the sysctl tree. The number of variables would be limited to
only one or two (maybe three :-).

-- 
Marcel Moolenaar                        mailto:marcel@scc.nl
SCC Internetworking & Databases           http://www.scc.nl/
The FreeBSD project                mailto:marcel@FreeBSD.org


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




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