From ac1f19d550a81c8408c8fce2e237996c950253ab Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Tue, 20 Aug 2019 09:10:53 +0200 Subject: [PATCH] Avoid warning about sys/sysctl.h on glibc-2.30. From glibc-2.30 NEWS: The Linux-specific 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 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__. --- ipc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ipc.c b/ipc.c index 85013a63..8e9dd51a 100644 --- a/ipc.c +++ b/ipc.c @@ -7,7 +7,6 @@ #include "ipc.h" #include #include -#include #include #include @@ -194,9 +193,8 @@ int shm_detach(void *addr) } # if defined __FreeBSD__ || defined __NetBSD__ +#include # define SYSCTL_SHMMAX_VARIABLE "kern.ipc.shmmax" -# elif defined __APPLE__ -# define SYSCTL_SHMMAX_VARIABLE "kern.sysv.shmmax" # else # undef SYSCTL_SHMMAX_VARIABLE # endif -- 2.30.2