From owner-freebsd-current Fri Oct 11 11:37:13 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id LAA16886 for current-outgoing; Fri, 11 Oct 1996 11:37:13 -0700 (PDT) Received: from critter.tfs.com ([140.145.230.177]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id LAA16868; Fri, 11 Oct 1996 11:36:58 -0700 (PDT) Received: from critter.tfs.com (localhost.tfs.com [127.0.0.1]) by critter.tfs.com (8.7.5/8.7.3) with ESMTP id UAA00409; Fri, 11 Oct 1996 20:36:14 +0200 (MET DST) To: Gary Jennejohn cc: freebsd-current@freebsd.org Subject: Re: invalid return value from sysctl_kern_proc ? In-reply-to: Your message of "Fri, 11 Oct 1996 19:57:23 -0000." <199610111957.TAA05925@peedub.gj.org> Date: Fri, 11 Oct 1996 20:36:14 +0200 Message-ID: <407.845058974@critter.tfs.com> From: Poul-Henning Kamp Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk In message <199610111957.TAA05925@peedub.gj.org>, Gary Jennejohn writes: >here's a fragment of code fom sysctl_kern_proc (/sys/kern/kern_proc.c) > > if (oidp->oid_number == KERN_PROC_PID) { > if (namelen != 1) > return (EINVAL); > p = pfind((pid_t)name[0]); > if (!p) > return (0); > ^^^^^^ shouldn't that be ESRCH ? > >I ask because sysctl isn't returning an error when I try to get the proc >struct for a non-existent process. Seems to me that it should. Well, it does, you don't get any data back. sysctl doesn't return error for things in the data domain it handles, only errors about the handling. -- Poul-Henning Kamp | phk@FreeBSD.ORG FreeBSD Core-team. http://www.freebsd.org/~phk | phk@login.dknet.dk Private mailbox. whois: [PHK] | phk@ref.tfs.com TRW Financial Systems, Inc. Future will arrive by its own means, progress not so.