Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 May 2014 22:38:42 -0400
From:      Ryan Stone <rysto32@gmail.com>
To:        Navdeep Parhar <np@freebsd.org>
Cc:        svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   Re: svn commit: r265478 - stable/9/sys/dev/cxgbe
Message-ID:  <CAFMmRNw5DvJvoxHdnLr4sZOGLnhK=W1oKDMtJS%2BBp=VPsDx02g@mail.gmail.com>
In-Reply-To: <201405070213.s472Dtip073500@svn.freebsd.org>
References:  <201405070213.s472Dtip073500@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, May 6, 2014 at 10:13 PM, Navdeep Parhar <np@freebsd.org> wrote:
> +       SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "temperature", CTLTYPE_INT |
> +           CTLFLAG_RD, sc, 0, sysctl_temperature, "A",
> +           "chip temperature (in Celsius)");

I believe that this is incorrect.  "A" is used for strings (I guess it
stands for ASCII?).  I would suggest using "IK", which is an
indication that the return value is an integer in tenths of degrees
Kelvin.  sysctl(8) will handle this value specially and print it in
degrees C.

You can take a look at dev/coretemp, which uses this sysctl format.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFMmRNw5DvJvoxHdnLr4sZOGLnhK=W1oKDMtJS%2BBp=VPsDx02g>