From b13081691e27f6cc62628d0fc38b1a9f5e290bc5 Mon Sep 17 00:00:00 2001 From: Vanilla Hsu Date: Fri, 12 Mar 2010 15:14:54 +0800 Subject: [PATCH] use getpagesize() to get PAGE_SIZE on FreeBSD. --- src/node.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node.cc b/src/node.cc index b7fad3055e..5e8f752f86 100644 --- a/src/node.cc +++ b/src/node.cc @@ -597,6 +597,7 @@ int getmem(size_t *rss, size_t *vsize) { struct kinfo_proc *kinfo = NULL; pid_t pid; int nprocs; + size_t page_size = getpagesize(); pid = getpid(); @@ -606,7 +607,7 @@ int getmem(size_t *rss, size_t *vsize) { kinfo = kvm_getprocs(kd, KERN_PROC_PID, pid, &nprocs); if (kinfo == NULL) goto error; - *rss = kinfo->ki_rssize * PAGE_SIZE; + *rss = kinfo->ki_rssize * page_size; *vsize = kinfo->ki_size; kvm_close(kd);