Bug#878705: using sysctl.h is a bug

Adam Borowski kilobyte at angband.pl
Mon Oct 16 00:32:29 UTC 2017


While it might sound like just "makers of some weird architecture no one
heard about haven't implemented this interface yet", it's not the case here.

Because of flaws of this interface, even on old architectures, trying to use
this syscall[1] printks a warning.  On the other hand, on certain kernels
other than Linux, sysctl() remains useful, thus some programs #include
sysctl.h if it exists, even when they don't actually use it (as they won't
on Linux).

The problem here is that on x32 sysctl.h exists but causes a compile error.

Thus, it's best to never #include it on Linux.



[1]. It's not removed entirely because programs compiled with very ancient
versions of glibc won't run otherwise.
-- 
⢀⣴⠾⠻⢶⣦⠀ Meow!
⣾⠁⢰⠒⠀⣿⡁
⢿⡄⠘⠷⠚⠋⠀ I was born a dumb, ugly and work-loving kid, then I got swapped on
⠈⠳⣄⠀⠀⠀⠀ the maternity ward.



More information about the debian-science-maintainers mailing list