diff options
Diffstat (limited to 'usr.bin/procstat/procstat_vm.c')
-rw-r--r-- | usr.bin/procstat/procstat_vm.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/procstat/procstat_vm.c b/usr.bin/procstat/procstat_vm.c index 5c965a9..2eada92 100644 --- a/usr.bin/procstat/procstat_vm.c +++ b/usr.bin/procstat/procstat_vm.c @@ -32,6 +32,7 @@ #include <err.h> #include <errno.h> +#include <libprocstat.h> #include <stdio.h> #include <stdlib.h> #include <stdint.h> @@ -40,7 +41,7 @@ #include "procstat.h" void -procstat_vm(pid_t pid, struct kinfo_proc *kipp __unused) +procstat_vm(struct kinfo_proc *kipp) { struct kinfo_vmentry *freep, *kve; int ptrwidth; @@ -53,12 +54,12 @@ procstat_vm(pid_t pid, struct kinfo_proc *kipp __unused) "PID", ptrwidth, "START", ptrwidth, "END", "PRT", "RES", "PRES", "REF", "SHD", "FL", "TP", "PATH"); - freep = kinfo_getvmmap(pid, &cnt); + freep = kinfo_getvmmap(kipp->ki_pid, &cnt); if (freep == NULL) return; for (i = 0; i < cnt; i++) { kve = &freep[i]; - printf("%5d ", pid); + printf("%5d ", kipp->ki_pid); printf("%#*jx ", ptrwidth, (uintmax_t)kve->kve_start); printf("%#*jx ", ptrwidth, (uintmax_t)kve->kve_end); printf("%s", kve->kve_protection & KVME_PROT_READ ? "r" : "-"); |