From owner-freebsd-current@FreeBSD.ORG Tue Mar 9 10:19:05 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CA8B816A4CE; Tue, 9 Mar 2004 10:19:05 -0800 (PST) Received: from smtp1.server.rpi.edu (smtp1.server.rpi.edu [128.113.2.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7322F43D1F; Tue, 9 Mar 2004 10:19:05 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp1.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i29IJ4LW002172; Tue, 9 Mar 2004 13:19:04 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <20040309085843.GD55680@ip.net.ua> References: <20040309085843.GD55680@ip.net.ua> Date: Tue, 9 Mar 2004 13:19:03 -0500 To: Ruslan Ermilov From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) cc: current@freebsd.org Subject: Re: Question on 'ps -p ' in current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Mar 2004 18:19:05 -0000 At 10:58 AM +0200 3/9/04, Ruslan Ermilov wrote: >On Mon, Mar 08, 2004, Garance A Drosihn wrote: > > > > I think this behavior in current is an unplanned side-effect > > of the change in revision 1.46 of > > http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libkvm/kvm_proc.c >> >> where that was fixing a side-effect of a fix in revision 1.60 > > of malloc.c. > >I don't think that rev. 1.46 is the problem. The sysctl is what >returns ESRCH if no process exists. In RELENG_4, it returns 0. >See sys/kern/kern_proc.c:sysctl_kern_proc(), the handing of >KERN_PROC_PID. The semantics has been changed in rev. 1.192. Hmm. That could be it. I know 'ps' has behaved this way in 5.x for awhile, but I can't remember when it started. In fact, it behaved this way for awhile, then it returned to 4.x behavior, and then it went back to it's present behavior. That's why I haven't said anything until now. I kept thinking "someone else will fix this...". A recent change for rc.subr reminded me that no one else had commented on it. > > Should 'ps' in this situation behave like it does in -stable? Or >> is this a change that we deliberately wanted to make in -current? >> I would be willing to change 'ps' if people prefer the earlier > > behavior, but I'll leave it alone if this was an intentional change. > >I believe that the current behavior of KERN_PROC_PID is correct. >I personally don't care how ps(1) should behave if no PID exists. I do agree that kvm_getprocs() is doing what it should do, so I would only be changing the code in ps.c. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu