initgroups(3)


NAME
     initgroups - initialize the supplementary group id's from /etc/group

SYNOPSIS
     #include <sys/types.h>
     #include <grp.h>

     int initgroups(char *name, gid_t basegid)

DESCRIPTION
     Initgroups() is used by programs like  login(1),  or  su(1)  to  set  the
     supplementery  group  id's  for  the  user  they  are changing into.  The
     routine is called with the login name and the group id  of  the  user  as
     found in the password file.  Initgroups will then scan the group file for
     name in the group member list of each group.   A  group  the  user  is  a
     member  of will be added to the supplementary group id set.  The group id
     basegid is also added to this set.

DIAGNOSTICS
     Initgroups returns the return value of the setgroups(2) call.

SEE ALSO
     getgroups(2), getgrent(3).

AUTHOR
     Kees J. Bot (kjb@cs.vu.nl)