getprivgrp.2 (2010 09)

g
getprivgrp(2) getprivgrp(2)
[E2BIG] The request would require assigning privileges to more than
PRIV_MAXGRPS
groups.
[EFAULT] mask points to an illegal address. The reliable detection of this error is implemen-
tation dependent.
[EINVAL] mask has bits set for one or more unknown privileges.
[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), privileges(5).
2 Hewlett-Packard Company 2 HP-UX 11i Version 3: September 2010