Initializes supplementary group ID.
Standard C Library (libc.a)
int initgroups ( User, BaseGID)
const char *User;
int BaseGID;
The initgroups subroutine reads the defined group membership of the specified User parameter and sets the supplementary group ID of the current process to that value. The BaseGID parameter is always included in the supplementary group ID. The supplementary group is normally the principal user's group. If the user is in more than NGROUPS_MAX groups, set in the limits.h file, only NGROUPS_MAX groups are set, including the BaseGID group.
User | Identifies a user. |
BaseGID | Specifies an additional group to include in the group set. |
0 | Indicates that the subroutine was success. |
-1 | Indicates that the subroutine failed. The errno global variable is set to indicate the error. |
The getgid (getgid, getegid or gegidx Subroutine) subroutine, getgrent, getgrgid, getgrnam, putgrent, setgrent, or endgrent (getgrent, getgrgid, getgrnam, setgrent, or endgrent Subroutine) subroutine, getgroups (getgroups Subroutine) subroutine, setgroups subroutine.
The groups command, setgroups command.
List of Security and Auditing Subroutines, Subroutines, Example Programs, and Libraries in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.