From owner-freebsd-hackers@FreeBSD.ORG Sat Jan 15 21:53:59 2011 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 B2EA3106564A for ; Sat, 15 Jan 2011 21:53:59 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 477798FC0C for ; Sat, 15 Jan 2011 21:53:59 +0000 (UTC) Received: by wwf26 with SMTP id 26so4104343wwf.31 for ; Sat, 15 Jan 2011 13:53:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=pQzR6KLX3H0jAoE1T5XZObxlYyk2a4ceDloFyo8wjv8=; b=PuVFiapt4kotY/Zb+vVsWe4Om5ZbTC66QKmCTf7/auJJh8u9j8c0OpFkq1rnYNVob7 tEQzX4cPntWwrta9PQg/Ep3fwIubPEz3FEtS7vXg0k6rYKdsVSQ3sc2vAVkw67pkya2T 9Sy6gza5aptYwKMiJlIX6aIuOwgAVcJTTplIs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=EWpklBFLfD4Nhi2HYLKnGrGBBetBIIBukfK+uoeWTW/9fPO0DlzkIwp2JxwR7k7+Xb MMF3WB7excu5rw2PSE2FYYgp2VLg2PxJo4BeU1cofZVNIdOAf8DZxAQsXIoZ3abKHc5R 6igvdIRPZtMtSjENSo1B2SUdT/7tV3ZkBjQW4= MIME-Version: 1.0 Received: by 10.227.141.77 with SMTP id l13mr353102wbu.159.1295126538821; Sat, 15 Jan 2011 13:22:18 -0800 (PST) Received: by 10.227.59.3 with HTTP; Sat, 15 Jan 2011 13:22:18 -0800 (PST) In-Reply-To: References: Date: Sat, 15 Jan 2011 22:22:18 +0100 Message-ID: From: Oliver Pinter To: Harald Servat Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org Subject: Re: Question about sysctl-ing coretemp module values 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: Sat, 15 Jan 2011 21:53:59 -0000 http://oliverp.teteny.bme.hu/git/?p=base/AiBoost-sensord.git;a=blob;f=aiboost-sensord.c;h=349b612066eb0514a2d5c3035908e7418ca71500;hb=HEAD On 1/15/11, Harald Servat wrote: > Hello, > > First of all, forgive if this is not the appropiate list to ask this. > Could you point me the correct list if so? > > I'm writing a small program to capture the temperature reported by the > coretemp kernel module. I'm doing this by using the sysctl API. However, I'm > facing a problem when reading that value (dev.cpu.0.temperature, for > example). > > man 3 sysctl has an example (labeled as "To retrieve the standard search > path for the system utilities:") which seems great to me to know the length > of the OID it wants to read before running the "real" sysctl. I wrote a > similar example (attached) based on that, but it does not work appropiately. > The 1st call tells me that len = 4 (whereas the value for > dev.cpu.0.temperature is "37.0C" which should be 5 if \0 is not counted). > > Can anyone shed some light on what I'm doing wrong? > > Thank you very much! > -- > _________________________________________________________________ > Fry: You can see how I lived before I met you. > Bender: You lived before you met me?! > Fry: Yeah, lots of people did. > Bender: Really?! >