HP-UX Reference (11i v1 05/09) - 2 System Calls (vol 5)

g
getprivgrp(2) getprivgrp(2)
[EINVAL] grpid is out of range.
[EPERM] The caller is not a privileged user.
EXAMPLES
The following example prints out
PRIV_GLOBAL and the group IDs of the privilege groups to which the
user belongs:
#include <sys/types.h>
struct privgrp_map pgrplist[PRIV_MAXGRPS];
int i;
gid_t pgid;
getprivgrp (pgrplist);
for (i=0; i<PRIV_MAXGRPS; i++) {
if ((pgid = pgrplist[i].priv_groupno) != PRIV_NONE) {
if (pgid == PRIV_GLOBAL)
printf ("(PRIV_GLOBAL) ");
printf ("privilege group id = %d\n", pgid);
}
}
AUTHOR
getprivgrp() and setprivgrp() were developed by HP.
SEE ALSO
getprivgrp(1), setprivgrp(1M), setgroups(2), privgrp(4).
Section 2108 Hewlett-Packard Company 2 HP-UX 11i Version 1: September 2005