diff options
-rw-r--r-- | src/process_iterator.c | 4 | ||||
-rwxr-xr-x | tests/process_iterator_test | bin | 6895 -> 0 bytes |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/process_iterator.c b/src/process_iterator.c index fd35952..f0cee92 100644 --- a/src/process_iterator.c +++ b/src/process_iterator.c @@ -84,11 +84,13 @@ int close_process_iterator(struct process_iterator *it) { #include <sys/sysctl.h> #include <sys/user.h> +#include <fcntl.h> +#include <paths.h> int init_process_iterator(struct process_iterator *it) { char errbuf[_POSIX2_LINE_MAX]; /* Open the kvm interface, get a descriptor */ - if ((it->kd = kvm_open(NULL, NULL, NULL, 0, errbuf)) == NULL) { + if ((it->kd = kvm_openfiles(NULL, _PATH_DEVNULL, NULL, O_RDONLY, errbuf)) == NULL) { /* fprintf(stderr, "kvm_open: %s\n", errbuf); */ fprintf(stderr, "kvm_open: %s", errbuf); return -1; diff --git a/tests/process_iterator_test b/tests/process_iterator_test Binary files differdeleted file mode 100755 index 979cf89..0000000 --- a/tests/process_iterator_test +++ /dev/null |