From glibc-2.30 NEWS:
The Linux-specific <sys/sysctl.h> header and the sysctl function have
been deprecated and will be removed from a future version of glibc.
Compilation against the glibc-2.30 headers results in the following warning:
In file included from ipc.c:10:
/usr/include/sys/sysctl.h:21:2: warning: #warning "The <sys/sysctl.h> header is deprecated and will be removed." [-Wcpp]
On NetBSD and FreeBSD, however, we still need to include the header
to get the declaration of sysctlbyname(3).
This patch changes ipc.c to include sys/sysctl.h only if __FreeBSD__ or
__NetBSD__ is defined. Also remove the pointless check for __APPLE__.
#include "ipc.h"
#include <sys/types.h>
#include <sys/param.h>
-#include <sys/sysctl.h>
#include <sys/ipc.h>
#include <sys/shm.h>
}
# if defined __FreeBSD__ || defined __NetBSD__
+#include <sys/sysctl.h>
# define SYSCTL_SHMMAX_VARIABLE "kern.ipc.shmmax"
-# elif defined __APPLE__
-# define SYSCTL_SHMMAX_VARIABLE "kern.sysv.shmmax"
# else
# undef SYSCTL_SHMMAX_VARIABLE
# endif