libc: silence "Warning: missing sysctl for [0][3]

The warning results from sysctlnametomib() that uses an undocumented
FreeBSD kernel interface we do not support.

Fixes #4673
This commit is contained in:
Christian Helmuth 2023-09-25 16:51:06 +02:00
parent 9db4293d7a
commit a7a7c56ad6

View File

@ -73,7 +73,12 @@ extern "C" int __sysctl(const int *name, u_int namelen,
if (!oldp) /* check for write attempt */
return Errno(newp ? EPERM : EINVAL);
if (namelen != 2) return Errno(ENOENT);
if (namelen != 2)
return Errno(ENOENT);
/* reject special interface for sysctlnametomib() */
if (name[0] == 0 && name[1] == 3)
return Errno(ENOENT);
char *buf = (char*)oldp;
int index_a = name[0];