From owner-cvs-all Thu Oct 29 07:55:23 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA08964 for cvs-all-outgoing; Thu, 29 Oct 1998 07:55:23 -0800 (PST) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: from niobe.ewox.org (ppp027.uio.no [129.240.240.28]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA08934; Thu, 29 Oct 1998 07:55:13 -0800 (PST) (envelope-from finrod@niobe.ewox.org) Received: (from finrod@localhost) by niobe.ewox.org (8.9.1/8.8.8) id QAA04512; Thu, 29 Oct 1998 16:55:07 +0100 (CET) (envelope-from finrod) To: hackers@FreeBSD.ORG, committers@FreeBSD.ORG Subject: sysctl Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit From: finrod@ewox.org (Dag-Erling Coidan Smørgrav) Date: 29 Oct 1998 16:55:07 +0100 Message-ID: <86n26f7484.fsf@niobe.ewox.org> Lines: 16 X-Mailer: Gnus v5.3/Emacs 19.34 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk 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