initgroups
Purpose
Initializes group access list.
Library
Standard C Library (libc.a)
Syntax
int initgroups (user, basegid)
char *user;
int basegid;
Description
The initgroups subroutine reads the /etc/group file and
constructs the group access list for the user whose name
is specified by the user parameter. The basegid param-
eter is usually the group number from the /etc/password
file and, it is automatically included in the group list.
Warning: The initgroups subroutine uses the getgrent
subroutines. If the program that invokes initgroups uses
any of these subroutines, then calling initgroups over-
writes the static group structure.
Return Value
Upon successful completion, the initgroups subroutine
returns a value of 0. If the effective user ID of the
calling process is not superuser, then initgroups returns
a value of 1.
File
/etc/group
Related Information
In this book: "getgroups," "setgroups," and "getgrent,
getgrgid, getgrnam, setgrent, endgrent,"
The adduser command in AIX Operating System Commands Ref-
erence.