From: Jeremie Courreges-Anglas Date: Thu, 8 Dec 2016 09:55:04 +0000 (+0100) Subject: Use kvm_openfiles with KVM_NO_FILES on OpenBSD (#2061) X-Git-Tag: collectd-5.8.0~278^2~1 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=b088d09dfda9b42c5c31b12a1b77101dffdf8c5a;p=collectd.git Use kvm_openfiles with KVM_NO_FILES on OpenBSD (#2061) Starting with OpenBSD 6.1, access to kvm device is restricted by default, and processes plugin doesnt need specific privileges on it. Fixes 'permission denied' error messages with the kern.allowkmem sysctl defaulting to 0. --- diff --git a/src/processes.c b/src/processes.c index 86f690f3..4f61351a 100644 --- a/src/processes.c +++ b/src/processes.c @@ -1916,7 +1916,7 @@ static int ps_read(void) { ps_list_reset(); /* Open the kvm interface, get a descriptor */ - kd = kvm_open(NULL, NULL, NULL, 0, errbuf); + kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, errbuf); if (kd == NULL) { ERROR("processes plugin: Cannot open kvm interface: %s", errbuf); return (0);