Allow the KERN_PROC_PROC sysctl to be used without the useless 4th

name component, for consistency with KERN_PROC_ALL. Support for the
4-argument form will be removed some time before 5.2-R.
This commit is contained in:
Tim J. Robbins 2003-09-19 14:16:50 +00:00
parent 4cb5b1f936
commit 3ddaef4034
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=120233

View File

@ -919,12 +919,24 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS)
error = sysctl_out_proc(p, req, KERN_PROC_NOTHREADS);
return (error);
}
if (oidp->oid_number == KERN_PROC_ALL && !namelen)
;
else if (oidp->oid_number != KERN_PROC_ALL && namelen == 1)
;
else
return (EINVAL);
switch (oidp->oid_number) {
case KERN_PROC_ALL:
case KERN_PROC_PROC:
/*
* XXX Temporarily disabled for compat with old userland
* that passes an extra unused argument to KERN_PROC_PROC.
*/
#if 0
if (namelen != 0)
return (EINVAL);
#endif
break;
default:
if (namelen != 1)
return (EINVAL);
break;
}
if (!req->oldptr) {
/* overestimate by 5 procs */