Allow freebsd32 __sysctl(2) to return ENOMEM.

This is required by programs like sockstat that read variably sized
sysctls such as kern.file.  The normal path has no such restriction and
the restriction was added without comment along with initial support for
freebsd32 in 2002 (r100384).

Reviewed by:	kib
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D15438
This commit is contained in:
Brooks Davis 2018-05-15 16:24:58 +00:00
parent e757cb8ecb
commit e15f0023ed

View File

@ -2263,7 +2263,7 @@ freebsd32_sysctl(struct thread *td, struct freebsd32_sysctl_args *uap)
error = userland_sysctl(td, name, uap->namelen,
uap->old, &oldlen, 1,
uap->new, uap->newlen, &j, SCTL_MASK32);
if (error && error != ENOMEM)
if (error)
return (error);
if (uap->oldlenp)
suword32(uap->oldlenp, j);