1.\" Copyright (c) 1983, 1991 Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" %sccs.include.redist.man% 5.\" 6.\" @(#)initgroups.3 6.3 (Berkeley) 04/19/91 7.\" 8.Dd 9.Dt INITGROUPS 3 10.Os BSD 4.2 11.Sh NAME 12.Nm initgroups 13.Nd initialize group access list 14.Sh SYNOPSIS 15.Fd #include <unistd.h> 16.Ft int 17.Fn initgroups "const char *name" "int basegid" 18.Sh DESCRIPTION 19The 20.Fn initgroups 21function 22reads through the group file and sets up, 23using the 24.Xr setgroups 2 25call, the group access list for the user 26specified in 27.Fa name . 28The 29.Fa basegid 30is automatically included in the groups list. 31Typically this value is given as 32the group number from the password file. 33.Sh RETURN VALUES 34The 35.Fn initgroups 36function 37returns \-1 if it was not invoked by the super-user. 38.Sh FILES 39.Bl -tag -width /etc/group -compact 40.It Pa /etc/group 41.El 42.Sh SEE ALSO 43.Xr setgroups 2 , 44.Sh HISTORY 45The 46.Nm 47function appeared in 48.Bx 4.2 . 49.Sh BUGS 50The 51.Fn initgroups 52function 53uses the routines based on 54.Xr getgrent 3 . 55If the invoking program uses any of these routines, 56the group structure will 57be overwritten in the call to 58.Fn initgroups . 59