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

Adhemerval Zanella adhemerval.zanella@linaro.org
Wed Mar 25 12:37:54 GMT 2020



On 25/03/2020 06:18, Florian Weimer wrote:
> * 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.

The x86_64/i686 and arm is a Ubuntu kernel, the s390x is a SLES
one. But kernel does used to provide sysctl syscall up to version 
2.6.36 (CONFIG_SYSCTL_SYSCALL was removed by
8b1bb90701f9a51f10ce8a990bcc1e237cb3b1c7). 

My impression is this change might characterize a 'don't break user 
space' issue, but I am not exactly sure why the kernel developers
had done it. Neither why Ubuntu/SUSE guys has explicit enable it on 
recent kernels.

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



More information about the Libc-alpha mailing list