From 25adb2eb55ea46b25b9ddbe8f1e0208ea6b61d1f Mon Sep 17 00:00:00 2001 From: Vanilla Hsu Date: Wed, 7 Apr 2010 11:39:29 +0800 Subject: [PATCH] [FreeBSD] use /dev/null instead /dev/mem Without this patch, Node needs to setgid kmem when run as normal user. --- src/node.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node.cc b/src/node.cc index 71405018ae6..3da989c00f7 100644 --- a/src/node.cc +++ b/src/node.cc @@ -673,6 +673,7 @@ int getmem(size_t *rss, size_t *vsize) { #include #include #include +#include #include #include @@ -685,7 +686,7 @@ int getmem(size_t *rss, size_t *vsize) { pid = getpid(); - kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open"); + kd = kvm_open(NULL, _PATH_DEVNULL, NULL, O_RDONLY, "kvm_open"); if (kd == NULL) goto error; kinfo = kvm_getprocs(kd, KERN_PROC_PID, pid, &nprocs);