Examples of sysctl/sysctlbyname/sysctlnametomib?

Marcin Cieslak saper at system.pl
Mon Jan 14 08:15:11 PST 2008


Jeremy Chadwick wrote:
> Does anyone know of some documentation which would help explain how to
> walk the sysctl MIB tree for such things as dev.cpu?  The sysctl(3)
> documentation is not very clear in regards to how to do this, and the
> closest thing I can find is what's in src/usr.sbin/powerd/powerd.c.

Does sysctl_all() of src/sbin/sysctl/sysctl.c does that what you need?
Mightt be easier to iterate a whole subtree and skipping things you
don't need.

--Marcin



More information about the freebsd-hackers mailing list