summaryrefslogtreecommitdiffstats
path: root/bin/ps/print.c
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2011-06-14 16:50:16 +0000
committertrasz <trasz@FreeBSD.org>2011-06-14 16:50:16 +0000
commit0b41fa9638f2db7aece9c1ee748bf6b0e621df18 (patch)
treefb18221bf363482b28baee819b51740b100f4755 /bin/ps/print.c
parent9d45c190c83f9be0326790e82d82a5eb1ce395c7 (diff)
downloadFreeBSD-src-0b41fa9638f2db7aece9c1ee748bf6b0e621df18.zip
FreeBSD-src-0b41fa9638f2db7aece9c1ee748bf6b0e621df18.tar.gz
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>
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 432cffa..02c6112 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;
OpenPOWER on IntegriCloud