[PATCH v2] Linux: Remove <sys/sysctl.h> and the sysctl function

Florian Weimer fw@deneb.enyo.de
Wed Mar 25 09:18:46 GMT 2020


* Adhemerval Zanella via Libc-alpha:

> On 13/03/2020 14:53, Florian Weimer wrote:
>> * Adhemerval Zanella via Libc-alpha:
>> 
>>> I still think we should keep the syscall call on compat symbol
>>> for architecture that do not return ENOSYS.
>> 
>> The kernel will return ENOSYS instead because support for the system
>> call is optional it is almost never compiled in, as far as I know.
>> 
>
> What I am seeing is with the sysctl example from man-pages is:
>
>                aarch64: !SYS__sysctl
>                  alpha: ENOSYS
>                    arm: OK		(4.12.13)
>                   hppa: ?
>                   i686: OK		(4.15.0-54-generic)
>                   ia64: ENOSYS
>                   m68k: ENOSYS
>             microblaze: ?
>                   mips: ENOSYS
>                 mips64: ENOSYS
>             mips64-n32: ENOSYS
>                  nios2: !SYS__sysctl
>                powerpc: ENOSYS
>              powerpc64: ENOSYS
>            powerpc64le: ENOSYS
>                riscv64: !SYS__sysctl
>                   s390: OK		(4.12.14-197.21-default)
>                  s390x: OK		(4.12.14-197.21-default)
>                    sh4: ENOSYS
>                sparc64: ENOSYS
>                sparcv9: ENOSYS
>                 x86_64: OK		(4.15.0-54-generic)
>             x86_64-x32: FAIL
>
> With !SYS__sysctl being the __NR__sysctl not being defined in
> sys/syscall.h, ENOSYS is kernel return is, OK is the syscall
> does returns information, and '?' where __NR__sysctl is define
> but I don't have a way to test with a running kernel.
>
> So it seems that at least for arm, i686, x86_64, s390, and
> s390x the syscall does work.

Is this the Ubuntu distribution kernel?  It overrides the upstream
kernel defaults, unlike most other distributions.  I don't think
that's a good indicator of actual use.

Worst case, Ubuntu can carry a custom patch to re-enable sysctl if
they need it.


More information about the Libc-alpha mailing list