[FreeBSD] use /dev/null instead /dev/mem

Without this patch, Node needs to setgid kmem when run as normal user.
This commit is contained in:
Vanilla Hsu authored and Ryan Dahl committed 2010-04-06 22:05:12 -07:00
1 parent 38041fcaa0
commit 25adb2eb55
1 file changed
+2 -1
+2 -1
View File
@@ -673,6 +673,7 @@ int getmem(size_t *rss, size_t *vsize) {
#include <sys/param.h>
#include <sys/sysctl.h>
#include <sys/user.h>
#include <paths.h>
#include <fcntl.h>
#include <unistd.h>
@@ -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);