sysctl(3) interface

M. Warner Losh imp at bsdimp.com
Thu Feb 1 18:43:03 UTC 2007


In message: <86k5z3jylp.fsf at dwp.des.no>
            des at des.no (Dag-Erling Smørgrav) writes:
: Daniel Rudy <dr2867 at pacbell.net> writes:
: > I've been taking apart and analyzing the sysctl(8) program to gain a
: > better insight into how to use the sysctl(3) interface.  [...]
: > It's using an oid of 0 and 2 to get something, then it comes up with 440
: > and then a sequence of numbers that are incrementing in a peculiar
: > pattern.
: 
: sysctl(8) uses undocumented interfaces to a) enumerate the nodes in
: the sysctl tree and b) obtain the name of a node, given its OID.
: 
: > So, my question is, how do I walk the tree to get the PnP info for all
: > the devices in the system?
: 
: man 3 devinfo

devinfo -v

will also give that information.

Warner


More information about the freebsd-hackers mailing list