Date: 29 Oct 1998 16:55:07 +0100 From: finrod@ewox.org (Dag-Erling Coidan Smørgrav) To: hackers@FreeBSD.ORG, committers@FreeBSD.ORG Subject: sysctl Message-ID: <86n26f7484.fsf@niobe.ewox.org>
next in thread | raw e-mail | index | archive | help
While fixing a sysctl-related bug in arp, I noticed that sysctl(3) is kinda fubar. According to the man page, it either returns 0, or returns -1 and sets errno. However, reading src/lib/libc/gen/sysctl.c and src/sys/kern/kern_sysctl.c reveals that the sysctl syscall returns the error code directly, and the sysctl library function does a little of both. The "fix" I did to src/lib/libkvm/kvm_proc.c depends on sysctl(3) acting in accordance to the man page, which it doesn't (it returns ENOMEM instead of setting errno to ENOMEM and returning -1). Should sysctl(3) be fixed to act as documented, or should the man page be fixed to document reality? In both cases, sysctl(3) will neeed to be fixed since it does a little of both. DES -- Dag-Erling Smørgrav - finrod@ewox.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86n26f7484.fsf>