.\" Copyright (c) 1983, 1991 Regents of the University of California. .\" All rights reserved. .\" .\" %sccs.include.redist.man% .\" .\" @(#)initgroups.3 6.4 (Berkeley) 11/12/91 .\" .Dd .Dt INITGROUPS 3 .Os BSD 4.2 .Sh NAME .Nm initgroups .Nd initialize group access list .Sh SYNOPSIS .Fd #include .Ft int .Fn initgroups "const char *name" "int basegid" .Sh DESCRIPTION The .Fn initgroups function uses the .Xr getgrouplist 3 function to calculate the group access list for the user specified in .Fa name . This group list is then setup for the current process using .Xr setgroups 2 . The .Fa basegid is automatically included in the groups list. Typically this value is given as the group number from the password file. .Sh RETURN VALUES The .Fn initgroups function returns \-1 if it was not invoked by the super-user. .Sh SEE ALSO .Xr setgroups 2 , .Xr getgrouplist 3 .Sh HISTORY The .Nm function appeared in .Bx 4.2 . .Sh BUGS The .Fn getgrouplist function called by .Nm uses the routines based on .Xr getgrent 3 . If the invoking program uses any of these routines, the group structure will be overwritten in the call to .Fn initgroups .