summaryrefslogtreecommitdiffstats
path: root/bin/ps
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2004-02-22 17:59:31 +0000
committerdeischen <deischen@FreeBSD.org>2004-02-22 17:59:31 +0000
commitd06c2712674f56ef05d1f0d44e88f3da769af6f6 (patch)
tree9dec72dde906f49a85d7958f1492eefba6dd4e09 /bin/ps
parent6f8b1a92fb93583f2cf004b254ec2a947cb384c6 (diff)
downloadFreeBSD-src-d06c2712674f56ef05d1f0d44e88f3da769af6f6.zip
FreeBSD-src-d06c2712674f56ef05d1f0d44e88f3da769af6f6.tar.gz
Allow the -H option to show threads when selecting by uid, tty,
and pid.
Diffstat (limited to 'bin/ps')
-rw-r--r--bin/ps/ps.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/bin/ps/ps.c b/bin/ps/ps.c
index b288d71..0bf39c0 100644
--- a/bin/ps/ps.c
+++ b/bin/ps/ps.c
@@ -192,7 +192,7 @@ main(int argc, char *argv[])
case 'g':
break; /* no-op */
case 'H':
- showthreads = 1;
+ showthreads = KERN_PROC_INC_THREAD;
break;
case 'h':
prtheader = ws.ws_row > 5 ? ws.ws_row : 22;
@@ -349,21 +349,19 @@ main(int argc, char *argv[])
* get proc list
*/
if (nuids == 1) {
- what = KERN_PROC_UID;
+ what = KERN_PROC_UID | showthreads;
flag = *uids;
} else if (ttydev != NODEV) {
- what = KERN_PROC_TTY;
+ what = KERN_PROC_TTY | showthreads;
flag = ttydev;
} else if (pid != -1) {
- what = KERN_PROC_PID;
+ what = KERN_PROC_PID | showthreads;
flag = pid;
- } else if (showthreads == 1) {
- what = KERN_PROC_ALL;
- flag = 0;
} else {
- what = KERN_PROC_PROC;
+ what = showthreads != 0 ? KERN_PROC_ALL : KERN_PROC_PROC;
flag = 0;
}
+
/*
* select procs
*/
OpenPOWER on IntegriCloud