Page MenuHomeFreeBSD

Teach sysctl about the new optional suffix after IK to specify precision. Update input as well. Add IK to the manual (it was missing completely).
ClosedPublic

Authored by imp on Jul 24 2015, 5:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 1:45 AM
Unknown Object (File)
Wed, Apr 17, 1:45 AM
Unknown Object (File)
Wed, Apr 17, 1:44 AM
Unknown Object (File)
Wed, Apr 17, 1:44 AM
Unknown Object (File)
Wed, Apr 17, 1:44 AM
Unknown Object (File)
Wed, Apr 17, 1:27 AM
Unknown Object (File)
Jan 22 2024, 11:36 AM
Unknown Object (File)
Jan 18 2024, 6:51 AM
Subscribers

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage

Event Timeline

imp retitled this revision from to Teach sysctl about the new optional suffix after IK to specify precision. Update input as well. Add IK to the manual (it was missing completely)..
imp updated this object.
imp edited the test plan for this revision. (Show Details)

probably ok but could do with an example or better comments

sbin/sysctl/sysctl.c
708

so this int isn't just rounded to a granularity, it's actually scaled to an arbitrary amount.. do all the caller know what to do with this? Is there just one caller?

930

and the caller will never accidentally put anything in there > 9?

935

Am I right in assuming that this is the ultimate destination for the scaled number above.. do we have temperature sensors that have 3 digits of accuracy? or is this for use with "1" as a scaling factor?

share/man/man9/sysctl.9
327

this is not very clear.. an example would be nice.

sbin/sysctl/sysctl.c
708

There's only one caller (well, two, the input path and the output path). The number after the K is the number of digits after the decimal point reported, as an integer.

930

No.

935

Yes. Right now temperatures are reported only in deciKelvin. This allows one to report in any SI-sub units you want up to nanoKelvin (though as an integer, and for temperatures in every-day life, microKelvin is likely the limit because 2^31 tops out at 2100K).

share/man/man9/sysctl.9
327

There's no other examples in this rather terse paragraph. I am open to better wording though.

wblock added inline comments.
share/man/man9/sysctl.9
327

Table/list form along with expanded description of the IK[n] format from imp in IRC. Using .Cm for the formats is cribbed from printf.1. Insert/replace between "Currently used format names are:" and ".It Fa descr":

.Pp
.Bl -tag -width "S,TYPE" -compact -offset indent
.It Cm N
node
.It Cm A
.Li "char *"
.It Cm I
.Li "int"
.It Cm IK Ns Op Ar n
temperature in Kelvin, multiplied by an optional single digit power of
ten scaling factor: 1 (default) gives deciKelvin, 0 gives Kelvin, 3 gives
milliKelvin
.It Cm IU
.Li "unsigned int"
.It Cm L
.Li "long"
.It Cm LU
.Li "unsigned long"
.It Cm Q
.Li "quad_t"
.It Cm QU
.Li "u_quad_t"
.It Cm "S,TYPE"
.Li "struct TYPE"
structures
.El

wblock's updates. Some better comments. Less repetition, I hope.

Updating D3181: Teach sysctl about the new optional suffix after IK to specify

precision. Update input as well. Add IK to the manual (it was missing
completely).

share/man/man9/sysctl.9
321–342

I meant to leave the "currently used formats line" before this one, but looking at it now, it can be simpler and better:

Current format names:

share/man/man9/sysctl.9
321–342

"Current formats:"

Add current formats.

Updating D3181: Teach sysctl about the new optional suffix after IK to specify

precision. Update input as well. Add IK to the manual (it was missing
completely).

wblock added a reviewer: wblock.

Man page looks okay to me. Please check with igor -R and mandoc -Tlint, and update .Dd before commit. Thanks!

This revision is now accepted and ready to land.Jul 25 2015, 11:44 AM
This revision was automatically updated to reflect the committed changes.