summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/top/machine.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c
index 0bedc42da0f..5b5db66f81e 100644
--- a/usr.bin/top/machine.c
+++ b/usr.bin/top/machine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machine.c,v 1.70 2012/04/12 14:59:19 pirofti Exp $ */
+/* $OpenBSD: machine.c,v 1.71 2012/04/17 23:17:53 pirofti Exp $ */
/*-
* Copyright (c) 1994 Thorsten Lockert <tholo@sigmasoft.com>
@@ -332,8 +332,12 @@ get_process_info(struct system_info *si, struct process_select *sel,
int show_idle, show_system, show_threads, show_uid, show_pid, show_cmd;
int total_procs, active_procs;
struct kinfo_proc **prefp, *pp;
+ int what = KERN_PROC_KTHREAD;
- if ((pbase = getprocs(KERN_PROC_KTHREAD, 0, &nproc)) == NULL) {
+ if (sel->threads)
+ what |= KERN_PROC_SHOW_THREADS;
+
+ if ((pbase = getprocs(what, 0, &nproc)) == NULL) {
/* warnx("%s", kvm_geterr(kd)); */
quit(23);
}