From 5eebeafe1150790e6f524b9990f5a63173fd66ae Mon Sep 17 00:00:00 2001 From: =?utf8?q?Edgar=20Fu=C3=9F?= Date: Thu, 9 Jul 2020 21:27:38 +0200 Subject: [PATCH] Add pagesize/getpagesize() for NetBSD case In the NetBSD case (has sysctlbyname(), but prefers sysctl()), declare pagesize, #include and call getpagesize(). --- src/memory.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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) -- 2.39.5