Add "gid" and "group" keywords to display the effective group ID
and effective group name. Also, add "egid", "egroup" and "euid" aliases. PR: bin/146331 Submitted by: Jeremie Le Hen <jeremie at le-hen dot org>
This commit is contained in:
parent
aa76615dd1
commit
9acd91270f
@ -70,6 +70,7 @@ void pmem(KINFO *, VARENT *);
|
||||
void pri(KINFO *, VARENT *);
|
||||
void printheader(void);
|
||||
void priorityr(KINFO *, VARENT *);
|
||||
void egroupname(KINFO *, VARENT *);
|
||||
void rgroupname(KINFO *, VARENT *);
|
||||
void runame(KINFO *, VARENT *);
|
||||
void rvar(KINFO *, VARENT *);
|
||||
@ -78,6 +79,7 @@ int s_cputime(KINFO *);
|
||||
int s_label(KINFO *);
|
||||
int s_loginclass(KINFO *);
|
||||
int s_logname(KINFO *);
|
||||
int s_egroupname(KINFO *);
|
||||
int s_rgroupname(KINFO *);
|
||||
int s_runame(KINFO *);
|
||||
int s_systime(KINFO *);
|
||||
|
@ -88,12 +88,19 @@ static VAR var[] = {
|
||||
{"cpu", "CPU", NULL, 0, kvar, NULL, 3, KOFF(ki_estcpu), UINT, "d",
|
||||
0},
|
||||
{"cputime", "", "time", 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
|
||||
{"egid", "", "gid", 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
|
||||
{"egroup", "", "group", 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
|
||||
{"emul", "EMUL", NULL, LJUST, emulname, NULL, EMULLEN, 0, CHAR,
|
||||
NULL, 0},
|
||||
{"etime", "ELAPSED", NULL, USER, elapsed, NULL, 12, 0, CHAR, NULL, 0},
|
||||
{"etimes", "ELAPSED", NULL, USER, elapseds, NULL, 12, 0, CHAR, NULL, 0},
|
||||
{"euid", "", "uid", 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
|
||||
{"f", "F", NULL, 0, kvar, NULL, 8, KOFF(ki_flag), INT, "x", 0},
|
||||
{"flags", "", "f", 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
|
||||
{"gid", "GID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_groups),
|
||||
UINT, UIDFMT, 0},
|
||||
{"group", "GROUP", NULL, LJUST, egroupname, s_egroupname,
|
||||
USERLEN, 0, CHAR, NULL, 0},
|
||||
{"ignored", "", "sigignore", 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
|
||||
{"inblk", "INBLK", NULL, USER, rvar, NULL, 4, ROFF(ru_inblock), LONG,
|
||||
"ld", 0},
|
||||
|
@ -340,6 +340,22 @@ s_uname(KINFO *k)
|
||||
return (strlen(user_from_uid(k->ki_p->ki_uid, 0)));
|
||||
}
|
||||
|
||||
void
|
||||
egroupname(KINFO *k, VARENT *ve)
|
||||
{
|
||||
VAR *v;
|
||||
|
||||
v = ve->var;
|
||||
(void)printf("%-*s", v->width,
|
||||
group_from_gid(k->ki_p->ki_groups[0], 0));
|
||||
}
|
||||
|
||||
int
|
||||
s_egroupname(KINFO *k)
|
||||
{
|
||||
return (strlen(group_from_gid(k->ki_p->ki_groups[0], 0)));
|
||||
}
|
||||
|
||||
void
|
||||
rgroupname(KINFO *k, VARENT *ve)
|
||||
{
|
||||
|
11
bin/ps/ps.1
11
bin/ps/ps.1
@ -29,7 +29,7 @@
|
||||
.\" @(#)ps.1 8.3 (Berkeley) 4/18/94
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd April 18, 2011
|
||||
.Dd June 14, 2011
|
||||
.Dt PS 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -502,6 +502,12 @@ elapsed running time, in decimal integer seconds
|
||||
.It Cm flags
|
||||
the process flags, in hexadecimal (alias
|
||||
.Cm f )
|
||||
.It Cm gid
|
||||
effective group ID (alias
|
||||
.Cm egid )
|
||||
.It Cm group
|
||||
group name (from egid) (alias
|
||||
.Cm egroup )
|
||||
.It Cm inblk
|
||||
total blocks read (alias
|
||||
.Cm inblock )
|
||||
@ -629,7 +635,8 @@ process pointer
|
||||
.It Cm ucomm
|
||||
name to be used for accounting
|
||||
.It Cm uid
|
||||
effective user ID
|
||||
effective user ID (alias
|
||||
.Cm euid )
|
||||
.It Cm upr
|
||||
scheduling priority on return from system call (alias
|
||||
.Cm usrpri )
|
||||
|
Loading…
x
Reference in New Issue
Block a user