From owner-freebsd-hackers@FreeBSD.ORG Mon Jan 14 13:24:41 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00EE616A417 for ; Mon, 14 Jan 2008 13:24:41 +0000 (UTC) (envelope-from jdc@parodius.com) Received: from mx01.sc1.parodius.com (mx01.sc1.parodius.com [72.20.106.3]) by mx1.freebsd.org (Postfix) with ESMTP id 001AD13C447 for ; Mon, 14 Jan 2008 13:24:40 +0000 (UTC) (envelope-from jdc@parodius.com) Received: by mx01.sc1.parodius.com (Postfix, from userid 1000) id 46BCF1CC091; Mon, 14 Jan 2008 05:24:40 -0800 (PST) Date: Mon, 14 Jan 2008 05:24:40 -0800 From: Jeremy Chadwick To: freebsd-hackers@freebsd.org Message-ID: <20080114132440.GA71321@eos.sc1.parodius.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.16 (2007-06-09) Subject: Examples of sysctl/sysctlbyname/sysctlnametomib? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jan 2008 13:24:41 -0000 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 |