From owner-freebsd-hackers Thu Oct 29 08:59:05 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA16407 for freebsd-hackers-outgoing; Thu, 29 Oct 1998 08:59:05 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.15.68.22]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA16401; Thu, 29 Oct 1998 08:59:02 -0800 (PST) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id DAA22379; Fri, 30 Oct 1998 03:58:58 +1100 Date: Fri, 30 Oct 1998 03:58:58 +1100 From: Bruce Evans Message-Id: <199810291658.DAA22379@godzilla.zeta.org.au> To: committers@FreeBSD.ORG, finrod@ewox.org, hackers@FreeBSD.ORG Subject: Re: sysctl Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >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 I think you need to read the code again. All syscall functions in in the kernel (at the level of sysent[]) return the error code directly. Normal return values are returned indirectly in p->p_retval[]. >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 It already does, at least for the call near your fix in kvm_proc.c. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message