tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: sysctl() bugs
On Fri, Sep 12, 2008 at 06:10:54PM -0400, der Mouse wrote:
> I just had occasion to learn how sysctl hw.iostats works on 4.0. This
> has pointed up a bug in sysctl(), though whether the code or the doc is
> not clear to me. The manpage says the return value on success is the
> number of bytes copied out, but I'm seeing zero on success. (The byte
> count is being stored through the data-length pointer correctly.)
>
> Which is right? (I can generate a PR, but want to know whether it's
> sw-bug or doc-bug.)
Someone brought this up last month [1], and the thread concluded with the
suggestion that it was a documentation bug. I'm not sure if it was actually
fixed or not, so it might be worth opening a PR.
FWIW, it looks like FreeBSD [2] returns 0 on success, or -1 on failure, and
OpenBSD [3] returns -1 on failure with no mention of any specific value on
success. This seems to support the conclusion that it's a doc-bug.
[1] http://mail-index.netbsd.org/tech-kern/2008/08/19/msg002473.html
[2]
http://www.freebsd.org/cgi/man.cgi?query=sysctl&sektion=3&apropos=0&manpath=FreeBSD+7.0-RELEASE
[3]
http://www.openbsd.org/cgi-bin/man.cgi?query=sysctl&sektion=3&arch=&apropos=0&manpath=OpenBSD+Current
--
Jason V. Miller
Home |
Main Index |
Thread Index |
Old Index