Sets the supplementary group ID of the current process.
Standard C Library (libc.a)
#include <grp.h>
int setgroups ( NumberGroups, GroupIDSet)
int NumberGroups;
gid_t *GroupIDSet;
The setgroups subroutine sets the supplementary group ID of the process. The setgroups subroutine cannot set more than NGROUPS_MAX groups in the group set. (NGROUPS_MAX is a constant defined in the limits.h file.)
GroupIDSet | Pointer to the array of group IDs to be established. |
NumberGroups | Indicates the number of entries in the GroupIDSet parameter. |
Upon successful completion, the setgroups subroutine returns a value of 0. Otherwise, a value of -1 is returned and the errno global variable is set to indicate the error.
The setgroups subroutine fails if any of the following are true:
Auditing Events:
Event | Information |
---|---|
PROC_SetGroups | NumberGroups, GroupIDSet |
The getgid subroutine, getgroups subroutine, initgroups subroutine, setgid (setgid, setrgid, setegid, setregid, or setgidx Subroutine) subroutine.
List of Security and Auditing Subroutines and Subroutines Overview in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.