Do not use <sys/sysctl.h> on Linux

glibc 2.30 deprecated the <sys/sysctl.h> header [1].  However, that
header is still used on other Unix-like systems, so only prevent it from
being used on Linux, in order to prevent compiler warnings from being
triggered.

[1] https://sourceware.org/ml/libc-alpha/2019-08/msg00029.html
This commit is contained in:
Michał Kępień
2019-11-06 15:31:47 +01:00
parent 89f874e6ee
commit 65a8b53bd0
3 changed files with 3 additions and 3 deletions

View File

@@ -12,7 +12,7 @@
#include <isc/meminfo.h>
#include <inttypes.h>
#include <unistd.h>
#ifdef HAVE_SYS_SYSCTL_H
#if defined(HAVE_SYS_SYSCTL_H) && !defined(__linux__)
#include <sys/sysctl.h>
#endif

View File

@@ -12,7 +12,7 @@
#include <stdbool.h>
#include <sys/types.h>
#if defined(HAVE_SYS_SYSCTL_H)
#if defined(HAVE_SYS_SYSCTL_H) && !defined(__linux__)
#if defined(HAVE_SYS_PARAM_H)
#include <sys/param.h>
#endif

View File

@@ -18,7 +18,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_SYSCTL_H
#if defined(HAVE_SYS_SYSCTL_H) && !defined(__linux__)
#include <sys/sysctl.h>
#endif
#include <sys/time.h>