Search code examples
clinuxlinux-kernel

linux header <linux/sysctl.h> deprecated


is linux header <linux/sysctl.h> deprecated ?

I read this on man 2 sysctl:

This system call first appeared in Linux 1.3.57. It was removed in Linux 5.5; glibc support was removed in version 2.32.

I misunderstood this line?

How to change system parameters in future (after removal)?


Solution

    1. It has the deprecated attribute.
    [[deprecated]] int _sysctl(struct __sysctl_args *args);
    
    1. The description states that it no longer exists on current kernels.

    This system call no longer exists on current kernels!

    1. "NOTES" suggest using /proc/sys interface:

    Use of this system call was long discouraged: since Linux 2.6.24, uses of this system call result in warnings in the kernel log, and in Linux 5.5, the system call was finally removed. Use the /proc/sys interface instead.

    and the man page links to this: proc.

    So yes, it is deprecated.