Date: Mon, 14 Jan 2008 05:24:40 -0800 From: Jeremy Chadwick <koitsu@FreeBSD.org> To: freebsd-hackers@freebsd.org Subject: Examples of sysctl/sysctlbyname/sysctlnametomib? Message-ID: <20080114132440.GA71321@eos.sc1.parodius.com>
next in thread | raw e-mail | index | archive | help
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. I'm attempting to retrieve the integer values for dev.cpu.X.temperature. For example, using sysctlbyname("dev.cpu.X.temperature") does work, but the results returned in *oldp don't match that of what sysctl(8) shows. This lead me to consider using sysctlnametomib("dev.cpu.X"), which also returns success, but from there I'm confused... Thanks... :-) -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080114132440.GA71321>