提交 3338c40b 编写于 作者: D Daniel P. Berrangé

network: avoid including sys/sysctl.h on Linux

The sys/sysctl.h header is only needed on BSD platforms to get
the sysctlbyname() function declaration. On Linux we talk to
procfs instead to change sysctls.

Unfortunately a legacy sys/sysctl.h header does exist on Linux
and including it has recently started triggering a deprecation
warning from glibc.

Protect its inclusion with a HAVE_SYSCTLBYNAME check instead
so that it only gets used on platforms where we need that
function declaration.
Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 05807e5d
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <net/if.h> #include <net/if.h>
#if HAVE_SYS_SYSCTL_H #ifdef HAVE_SYSCTLBYNAME
# include <sys/sysctl.h> # include <sys/sysctl.h>
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册