On Fri, Mar 16, 2001 at 08:23:51PM -0800, Dima Dorfman wrote:
> Obviously, this isn't the desired mode of failure. Attached is a
> patch that will make sysctl_kern_proc return ESRCH if it didn't find
> any processes. AFAIK, without the patch, the only way to detect this
> condition (no processes match search criteria) is to check that a call
> into this routine via sysctl didn't modify whatever is pointed at by
> the oldp pointer (see sysctl(3)).
I went for a much simpler patch that just skipped the struct size
check if the amount of data returned was zero. This is what the
old code did (effectively) before the the struct size check changed.
(Patch just posted to -current).
David.
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message