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:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user