From: Edgar Fuß Date: Thu, 9 Jul 2020 19:27:38 +0000 (+0200) Subject: Add pagesize/getpagesize() for NetBSD case X-Git-Tag: collectd-5.12.0~14^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5eebeafe1150790e6f524b9990f5a63173fd66ae;p=thirdparty%2Fcollectd.git Add pagesize/getpagesize() for NetBSD case In the NetBSD case (has sysctlbyname(), but prefers sysctl()), declare pagesize, #include and call getpagesize(). --- diff --git a/src/memory.c b/src/memory.c index 6e10ab035..440a5f9cb 100644 --- a/src/memory.c +++ b/src/memory.c @@ -69,7 +69,12 @@ static vm_size_t pagesize; /* #endif HAVE_HOST_STATISTICS */ #elif HAVE_SYSCTLBYNAME +#if HAVE_SYSCTL && defined(KERNEL_NETBSD) +static int pagesize; +#include /* getpagesize() */ +#else /* no global variables */ +#endif /* #endif HAVE_SYSCTLBYNAME */ #elif KERNEL_LINUX @@ -128,7 +133,11 @@ static int memory_init(void) { /* #endif HAVE_HOST_STATISTICS */ #elif HAVE_SYSCTLBYNAME - /* no init stuff */ +#if HAVE_SYSCTL && defined(KERNEL_NETBSD) + pagesize = getpagesize(); +#else +/* no init stuff */ +#endif /* HAVE_SYSCTL && defined(KERNEL_NETBSD) */ /* #endif HAVE_SYSCTLBYNAME */ #elif defined(KERNEL_LINUX)