mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
[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:
1 parent
38041fcaa0
commit
25adb2eb55
1 file changed
+2
-1
+2
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user