From owner-freebsd-hackers@FreeBSD.ORG Sat Jan 15 20:38:04 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 43B52106566C for ; Sat, 15 Jan 2011 20:38:04 +0000 (UTC) (envelope-from redcrash@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 099978FC0C for ; Sat, 15 Jan 2011 20:38:03 +0000 (UTC) Received: by iyb26 with SMTP id 26so3618247iyb.13 for ; Sat, 15 Jan 2011 12:38:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=mHLzjr5UzW2e1DMiSfr/kYmj2Lpwps3AfWMVLyLOiXM=; b=JH6YolXONu7jGE4StarZFbBskscVAiSmXlUedo9L2U9ZcsL5hloZVhSOr/KV270Kd9 n2lcfZlPMlWUy0RI6FxTUrOjJR9Khw6VZRzFnTV3Raxbbv6oiJX9capVVwbud+cHQNB2 Iv9Oe67zGCPVzdYwZZaCqmtIp1kQk25i7zYmQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=UHaDbW0PsOddES0xFlgoJjQmpjCS7rMDe02OQgiWbqqjaKdLiX0fk5KBiL+3GY+jm9 JjuyBGvEojw+g3anBv8MJajt/YNKEVr5DvaqLyZFaUjRSdw1MLHkxtY0A/81ZjWcaQzz nX0mN0hpKXxyd6ciXaK7CS47wzf4KHdG1/FGA= MIME-Version: 1.0 Received: by 10.231.206.1 with SMTP id fs1mr2220238ibb.193.1295122162611; Sat, 15 Jan 2011 12:09:22 -0800 (PST) Received: by 10.231.32.194 with HTTP; Sat, 15 Jan 2011 12:09:22 -0800 (PST) Date: Sat, 15 Jan 2011 21:09:22 +0100 Message-ID: From: Harald Servat To: freebsd-hackers@freebsd.org Content-Type: multipart/mixed; boundary=90e6ba53b5287174c70499e82090 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: 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 20:38:04 -0000 --90e6ba53b5287174c70499e82090 Content-Type: text/plain; charset=ISO-8859-1 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?! --90e6ba53b5287174c70499e82090--