aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorGarance A Drosehn <gad@FreeBSD.org>2004-05-22 23:13:58 +0000
committerGarance A Drosehn <gad@FreeBSD.org>2004-05-22 23:13:58 +0000
commit7bd421650b29129386046e482b525651d84e7926 (patch)
tree97848fe2a74226a2c8c40ee796306b5227482881 /bin
parentb8fdc89d790d6f2130895f0fe1e0f0d7c87b3a9c (diff)
downloadsrc-7bd421650b29129386046e482b525651d84e7926.tar.gz
src-7bd421650b29129386046e482b525651d84e7926.zip
Change `ps' to use the KERN_PROC_RGID and KERN_PROC_SESSION options
(if trying to match only one real-group or one session-id), now that those options are implemented in src/sys/kern/kern_proc.c (v1.203). PR: bin/65803 (a very tiny piece of the PR) Submitted by: Cyrille Lefevre
Notes
Notes: svn path=/head/; revision=129600
Diffstat (limited to 'bin')
-rw-r--r--bin/ps/ps.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/bin/ps/ps.c b/bin/ps/ps.c
index 9c645694915c..5a65aa4db37c 100644
--- a/bin/ps/ps.c
+++ b/bin/ps/ps.c
@@ -462,8 +462,11 @@ main(int argc, char *argv[])
what = showthreads != 0 ? KERN_PROC_ALL : KERN_PROC_PROC;
flag = 0;
if (nselectors == 1) {
- /* XXX - Apparently there's no KERN_PROC_GID flag. */
- if (pgrplist.count == 1) {
+ if (gidlist.count == 1) {
+ what = KERN_PROC_RGID | showthreads;
+ flag = *gidlist.l.gids;
+ nselectors = 0;
+ } else if (pgrplist.count == 1) {
what = KERN_PROC_PGRP | showthreads;
flag = *pgrplist.l.pids;
nselectors = 0;
@@ -475,16 +478,10 @@ main(int argc, char *argv[])
what = KERN_PROC_RUID | showthreads;
flag = *ruidlist.l.uids;
nselectors = 0;
-#if 0
- /*-
- * XXX - KERN_PROC_SESSION causes error in kvm_getprocs?
- * For now, always do sid-matching in this routine.
- */
} else if (sesslist.count == 1) {
what = KERN_PROC_SESSION | showthreads;
flag = *sesslist.l.pids;
nselectors = 0;
-#endif
} else if (ttylist.count == 1) {
what = KERN_PROC_TTY | showthreads;
flag = *ttylist.l.ttys;