summaryrefslogtreecommitdiff
path: root/bin/ps
diff options
context:
space:
mode:
authorPaul Irofti <pirofti@cvs.openbsd.org>2012-04-17 23:17:54 +0000
committerPaul Irofti <pirofti@cvs.openbsd.org>2012-04-17 23:17:54 +0000
commit9423fd636fbb829a3beb96e6bf91a8435aca0dac (patch)
tree662e13cd8db382c4a64c9981a968e8662067d7d4 /bin/ps
parent0dda1e76ea40698dad18b59045a473096026880e (diff)
Make it optional for kvm_getprocs() (and related sysctl) to return
thread information. Add a KERN_PROC_SHOW_THREADS flag that has to be set in order to get the thread info and make it off by default. This creates backwards compatibility for applications that relied on a given size/number of items to be returned. Modify ps(1) and top(1) accordingly. Okay guenther@.
Diffstat (limited to 'bin/ps')
-rw-r--r--bin/ps/ps.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/ps/ps.c b/bin/ps/ps.c
index 77a0e48f97f..0577bfa1563 100644
--- a/bin/ps/ps.c
+++ b/bin/ps/ps.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ps.c,v 1.53 2012/04/12 14:59:19 pirofti Exp $ */
+/* $OpenBSD: ps.c,v 1.54 2012/04/17 23:17:53 pirofti Exp $ */
/* $NetBSD: ps.c,v 1.15 1995/05/18 20:33:25 mycroft Exp $ */
/*-
@@ -307,6 +307,8 @@ main(int argc, char *argv[])
what = KERN_PROC_ALL;
flag = 0;
}
+ if (showthreads)
+ what |= KERN_PROC_SHOW_THREADS;
/*
* select procs