Subject: misc/23190: sysctl(3) manpage has wrong data type for KERN_CP_TIME
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <email@example.com>
Date: 10/19/2003 01:46:40
>Synopsis: sysctl(3) manpage has wrong data type for KERN_CP_TIME
>Arrival-Date: Sun Oct 19 01:47:00 UTC 2003
>Originator: Adam Sampson
NetBSD mcnaught 1.6 NetBSD 1.6 (GENERIC) #0: Sun Sep 8 19:43:40 UTC 2002 firstname.lastname@example.org:/autobuild/i386/OBJ/autobuild/src/sys/arch/i386/compile/GENERIC i386
I'm porting libstatgrab to NetBSD at the moment, and I'm writing some code that uses sysctl() to read the CPU times vector. The sysctl(3) manual page says that KERN_CP_TIME's return data type is an array of CPUSTATES longs, but this won't work; it's actually an array of CPUSTATES u_int16_ts (as looking at the sysctl(8) source confirmed). There's also a couple of obvious typos in the description.
"man 3 sysctl", search for "CP_TIME".
Change the "Type" of KERN_CP_TIME in the CTL_KERN table to "u_int64_t", and the description below to something like:
"An array of CPUSTATES u_int16_t values is returned. This array contains the number of clock ticks spent in different CPU states."