From owner-freebsd-doc Thu Dec 13 2:30: 8 2001 Delivered-To: freebsd-doc@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 12BC337B41A for ; Thu, 13 Dec 2001 02:30:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id fBDAU1P20215; Thu, 13 Dec 2001 02:30:01 -0800 (PST) (envelope-from gnats) Received: from mailhub.fokus.gmd.de (mailhub.fokus.gmd.de [193.174.154.14]) by hub.freebsd.org (Postfix) with ESMTP id D9D6037B419 for ; Thu, 13 Dec 2001 02:28:13 -0800 (PST) Received: from fokus.gmd.de (beagle [193.175.132.100]) by mailhub.fokus.gmd.de (8.11.6/8.11.6) with ESMTP id fBDASC503682 for ; Thu, 13 Dec 2001 11:28:12 +0100 (MET) Received: (from hbb@localhost) by fokus.gmd.de (8.11.6/8.11.0) id fBDASCi51711; Thu, 13 Dec 2001 11:28:12 +0100 (CET) (envelope-from hbb) Message-Id: <200112131028.fBDASCi51711@fokus.gmd.de> Date: Thu, 13 Dec 2001 11:28:12 +0100 (CET) From: Hartmut Brandt Reply-To: Hartmut Brandt To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: docs/32793: Wrong error named in sysctl man page Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 32793 >Category: docs >Synopsis: Wrong error named in sysctl man page >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Thu Dec 13 02:30:00 PST 2001 >Closed-Date: >Last-Modified: >Originator: Hartmut Brandt >Release: FreeBSD 5.0-CURRENT i386 >Organization: Fhg Fokus >Environment: System: FreeBSD beagle.fokus.gmd.de 5.0-CURRENT FreeBSD 5.0-CURRENT #3: Mon Dec 10 11:29:08 CET 2001 hbb@beagle.fokus.gmd.de:/opt/obj/usr/src/sys/BEAGLE i386 >Description: The sysctl.3 man page describes sysctl() returning EOPNOTSUPP in the case the named variable is not found. This is obviously wrong because sysctl() returns ENOENT. There is only one instance of EOPNOTSUPP in kern_sysctl.c and this is for the BSDI 1.0 getkerninfo. >How-To-Repeat: Compile and run the following test program which tries to access an non-existing variable. See it printing an errno of 2 (ENOENT). #include #include #include #include #include #include #include #include #include int main(int argc, char *argv[]) { u_int ifnum; int name[6]; size_t len = sizeof(ifnum); name[0] = CTL_NET; name[1] = PF_LINK; name[2] = NETLINK_GENERIC; name[3] = IFMIB_SYSTEM; name[4] = 17; if (sysctl(name, 5, &ifnum, &len, NULL, 0) == -1) err(1, "sysctl %d", errno); return (0); } >Fix: Patch for /usr/src/lib/libc/gen/sysctl.3: Index: sysctl.3 =================================================================== RCS file: /usr/ncvs/src/lib/libc/gen/sysctl.3,v retrieving revision 1.51 diff -r1.51 sysctl.3 452c452 < .Er EOPNOTSUPP . --- > .Er ENOENT . 790c790 < .It Bq Er EOPNOTSUPP --- > .It Bq Er ENOENT >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message