Date: Sat, 17 Mar 2001 20:26:52 +0000 From: David Malone <dwmalone@maths.tcd.ie> To: John Baldwin <jhb@FreeBSD.org> Cc: David Malone <dwmalone@maths.tcd.ie>, mckusick@FreeBSD.org, current@FreeBSD.org, Alex Zepeda <jazepeda@pacbell.net>, Brooks Davis <brooks@one-eyed-alien.net>, dwmalone@maths.tcd.ie Subject: Re: very strange problem with ps Message-ID: <200103172026.aa59811@salmon.maths.tcd.ie> In-Reply-To: Your message of "Sat, 17 Mar 2001 09:51:34 PST." <XFMail.010317095134.jhb@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi? <200103172026.aa59811>