> 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 [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to