aboutsummaryrefslogtreecommitdiff
path: root/bin/ps/print.c
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2011-06-14 16:50:16 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2011-06-14 16:50:16 +0000
commit9acd91270f62a489c0e1db9a6937ee67d7390350 (patch)
treefb18221bf363482b28baee819b51740b100f4755 /bin/ps/print.c
parentaa76615dd1b6df8a2dd7b31cd183b59410b92c1e (diff)
downloadsrc-9acd91270f62a489c0e1db9a6937ee67d7390350.tar.gz
src-9acd91270f62a489c0e1db9a6937ee67d7390350.zip
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>
Notes
Notes: svn path=/head/; revision=223086
Diffstat (limited to 'bin/ps/print.c')
-rw-r--r--bin/ps/print.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/ps/print.c b/bin/ps/print.c
index 432cffa274d3..02c6112d5461 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -341,6 +341,22 @@ s_uname(KINFO *k)
}
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)
{
VAR *v;