-/* $OpenBSD: extern.h,v 1.21 2019/06/23 17:18:50 deraadt Exp $ */
+/* $OpenBSD: extern.h,v 1.22 2021/08/28 20:54:54 chrisz Exp $ */
/* $NetBSD: extern.h,v 1.10 1995/05/21 13:38:27 mycroft Exp $ */
/*-
double getpcpu(const struct kinfo_proc *);
double getpmem(const struct kinfo_proc *);
void gname(const struct kinfo_proc *, VARENT *);
+void supgid(const struct kinfo_proc *, VARENT *);
+void supgrp(const struct kinfo_proc *, VARENT *);
void logname(const struct kinfo_proc *, VARENT *);
void longtname(const struct kinfo_proc *, VARENT *);
void lstarted(const struct kinfo_proc *, VARENT *);
-/* $OpenBSD: keyword.c,v 1.47 2019/06/23 17:18:50 deraadt Exp $ */
+/* $OpenBSD: keyword.c,v 1.48 2021/08/28 20:54:54 chrisz Exp $ */
/* $NetBSD: keyword.c,v 1.12.6.1 1996/05/30 21:25:13 cgd Exp $ */
/*-
{"start", "STARTED", NULL, LJUST|USER, started, 8},
{"stat", "", "state"},
{"state", "STAT", NULL, LJUST|NLIST, printstate, 6},
+ {"supgid", "SUPGID", NULL, LJUST, supgid, 64},
+ {"supgrp", "SUPGRP", NULL, LJUST, supgrp, 64},
GID("svgid", "SVGID", pvar, POFF(p_svgid)),
UID("svuid", "SVUID", pvar, POFF(p_svuid)),
{"tdev", "TDEV", NULL, 0, tdev, 4},
-/* $OpenBSD: print.c,v 1.76 2021/04/05 00:51:14 kn Exp $ */
+/* $OpenBSD: print.c,v 1.77 2021/08/28 20:54:54 chrisz Exp $ */
/* $NetBSD: print.c,v 1.27 1995/09/29 21:58:12 cgd Exp $ */
/*-
ve->next != NULL);
}
+void
+supgid(const struct kinfo_proc *kp, VARENT *ve)
+{
+ char buf[1024];
+ char *p = buf;
+ ssize_t size = sizeof(buf);
+ int i, len;
+
+ for (i = 0; i < kp->p_ngroups; i++) {
+ len = snprintf(p, size, "%s%u",
+ p == buf ? "" : ",",
+ kp->p_groups[i]);
+ if (len < 0 || len >= size)
+ break;
+ p += len;
+ size -= len;
+ }
+
+ (void)printf("%-*s", ve->var->width, buf);
+}
+
+void
+supgrp(const struct kinfo_proc *kp, VARENT *ve)
+{
+ char buf[1024];
+ char *p = buf;
+ ssize_t size = sizeof(buf);
+ int i, len;
+
+ for (i = 0; i < kp->p_ngroups; i++) {
+ len = snprintf(p, size, "%s%s",
+ p == buf ? "" : ",",
+ group_from_gid(kp->p_groups[i], 0));
+ if (len < 0 || len >= size)
+ break;
+ p += len;
+ size -= len;
+ }
+
+ (void)printf("%-*s", ve->var->width, buf);
+}
+
void
tdev(const struct kinfo_proc *kp, VARENT *ve)
{
-.\" $OpenBSD: ps.1,v 1.117 2020/02/08 16:41:25 schwarze Exp $
+.\" $OpenBSD: ps.1,v 1.118 2021/08/28 20:54:54 chrisz Exp $
.\" $NetBSD: ps.1,v 1.16 1996/03/21 01:36:28 jtc Exp $
.\"
.\" Copyright (c) 1980, 1990, 1991, 1993, 1994
.\"
.\" @(#)ps.1 8.3 (Berkeley) 4/18/94
.\"
-.Dd $Mdocdate: February 8 2020 $
+.Dd $Mdocdate: August 28 2021 $
.Dt PS 1
.Os
.Sh NAME
On multiprocessor machines, specifies processor number
.Ar n .
.El
+.It Cm supgid
+Group IDs of supplementary groups.
+.It Cm supgrp
+Group names of supplementary groups.
.It Cm svgid
Saved GID from a setgid executable.
.It Cm svuid