From owner-freebsd-current Sat Mar 17 12:27: 1 2001 Delivered-To: freebsd-current@freebsd.org Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by hub.freebsd.org (Postfix) with SMTP id 59D4637B718; Sat, 17 Mar 2001 12:26:54 -0800 (PST) (envelope-from dwmalone@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 17 Mar 2001 20:26:53 +0000 (GMT) To: John Baldwin Cc: David Malone , mckusick@FreeBSD.org, current@FreeBSD.org, Alex Zepeda , Brooks Davis , dwmalone@maths.tcd.ie Subject: Re: very strange problem with ps In-reply-to: Your message of "Sat, 17 Mar 2001 09:51:34 PST." X-Request-Do: Date: Sat, 17 Mar 2001 20:26:52 +0000 From: David Malone Message-ID: <200103172026.aa59811@salmon.maths.tcd.ie> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > I actually prefer the ESRCH patch as a) it better describes what happens and b > it returns a proper error when no processes are found, making it easier for > other programs to detect this error condition. Programs should already be > checking for a error return from the sysctlbyname() that they use to get this > (or else they allow for kvm to inform them of errors) and thus won't need to > add in special case checks for 'size > 0'. errno is the standard way of > returning errors after all. :) It depends what you consider the sysctl to do - if it's job is returning a list of all processes belonging to a user and there aren't any then returning a list of length zero seems a reasonable thing to do. It's not that the list doesn't exist, it's that it is empty. Afterall strlen doesn't return an error for a string of length zero. ;-) Actually, I'm not all that fussed. I just think it's more likely that the new check is incorrect than go changing other code which seems to have been working fine. David. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message