From c3f750cfbf6ad75b2c75bdeb6a369e4f58371547 Mon Sep 17 00:00:00 2001 From: Garance A Drosehn Date: Tue, 30 Mar 2004 15:10:50 +0000 Subject: [PATCH] Use KERN_PROC_PROC instead of KERN_PROC_ALL on the call to kvm_getprocs(), so we get one line per process instead of one for each kernel-thread. Noticed by: ache & tjr --- usr.bin/pkill/pkill.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/usr.bin/pkill/pkill.c b/usr.bin/pkill/pkill.c index 4443416d7bf..565dc3cf1f4 100644 --- a/usr.bin/pkill/pkill.c +++ b/usr.bin/pkill/pkill.c @@ -260,7 +260,11 @@ main(int argc, char **argv) if (kd == NULL) errx(STATUS_ERROR, "kvm_openfiles(): %s", buf); - plist = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nproc); + /* + * Use KERN_PROC_PROC instead of KERN_PROC_ALL, since we + * just want processes and not individual kernel threads. + */ + plist = kvm_getprocs(kd, KERN_PROC_PROC, 0, &nproc); if (plist == NULL) errx(STATUS_ERROR, "kvm_getprocs() failed");