summaryrefslogtreecommitdiffstats
path: root/netbsd
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2021-08-30 19:25:01 +0200
committerBenBE <BenBE@geshi.org>2021-09-03 12:17:45 +0200
commitfd2c4f5dddeca60caaeb947b12eca929dec57289 (patch)
treeeec334f0d57939f361acee0c17bd5000cd5006b0 /netbsd
parent7f95ed8528e574a2da6e6e7a6abdd8bca359e4a3 (diff)
NetBSD: fix reading environment variables of processes
kvm_getenvv(3) seems not to work with kvm_openfiles(..., KVM_NO_FILES, ...)
Diffstat (limited to 'netbsd')
-rw-r--r--netbsd/Platform.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/netbsd/Platform.c b/netbsd/Platform.c
index d75e7f0b..70de2bd3 100644
--- a/netbsd/Platform.c
+++ b/netbsd/Platform.c
@@ -281,19 +281,19 @@ char* Platform_getProcessEnv(pid_t pid) {
char** ptr;
int count;
kvm_t* kt;
- struct kinfo_proc* kproc;
+ const struct kinfo_proc2* kproc;
size_t capacity = 4096, size = 0;
if ((kt = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, errbuf)) == NULL) {
return NULL;
}
- if ((kproc = kvm_getprocs(kt, KERN_PROC_PID, pid, &count)) == NULL) {
+ if ((kproc = kvm_getproc2(kt, KERN_PROC_PID, pid, sizeof(struct kinfo_proc2), &count)) == NULL) {
(void) kvm_close(kt);
return NULL;
}
- if ((ptr = kvm_getenvv(kt, kproc, 0)) == NULL) {
+ if ((ptr = kvm_getenvv2(kt, kproc, 0)) == NULL) {
(void) kvm_close(kt);
return NULL;
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy