From eb978e79e621f325a60381aafd93f62e6d4ba6b3 Mon Sep 17 00:00:00 2001 From: Ryo ONODERA Date: Sun, 30 Aug 2020 22:04:25 +0900 Subject: [PATCH] int is too short to handle RSS of 64-bit NetBSD architecture --- phymem_netbsd.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/phymem_netbsd.go b/phymem_netbsd.go index cd71c7a..6328a17 100644 --- a/phymem_netbsd.go +++ b/phymem_netbsd.go @@ -4,9 +4,10 @@ package phymem #include #include #include +#include #include -static int +static int64_t getRSS(void) { int ret; @@ -23,7 +24,7 @@ getRSS(void) long pagesize = sysconf(_SC_PAGESIZE); - return kp.p_vm_rssize * pagesize; + return (int64_t)(kp.p_vm_rssize * pagesize); } */ import "C"