xref: /csrg-svn/lib/libc/sys/setgroups.2 (revision 66832)
1*66832Sbostic.\" Copyright (c) 1983, 1991, 1993, 1994
261183Sbostic.\"	The Regents of the University of California.  All rights reserved.
320259Smckusick.\"
443568Strent.\" %sccs.include.redist.man%
520259Smckusick.\"
6*66832Sbostic.\"     @(#)setgroups.2	8.2 (Berkeley) 04/16/94
738053Sbostic.\"
847208Scael.Dd
947208Scael.Dt SETGROUPS 2
1047208Scael.Os BSD 4.2
1147208Scael.Sh NAME
1247208Scael.Nm setgroups
1347208Scael.Nd set group access list
1447208Scael.Sh SYNOPSIS
15*66832Sbostic.Fd #include <sys/param.h>
1647208Scael.Fd #include <unistd.h>
1747208Scael.Ft int
18*66832Sbostic.Fn setgroups "int ngroups" "const gid_t *gidset"
1947208Scael.Sh DESCRIPTION
2047208Scael.Fn Setgroups
2120259Smckusicksets the group access list of the current user process
2220259Smckusickaccording to the array
2347208Scael.Fa gidset .
2420259SmckusickThe parameter
2547208Scael.Fa ngroups
2620259Smckusickindicates the number of entries in the array and must be no
2747208Scaelmore than
2847208Scael.Dv NGROUPS ,
2947208Scaelas defined in
3047208Scael.Ao Pa sys/param.h Ac .
3147208Scael.Pp
3220259SmckusickOnly the super-user may set new groups.
3347208Scael.Sh RETURN VALUES
3447208ScaelA 0 value is returned on success, -1 on error, with
3547208Scaelan error code stored in
3647208Scael.Va errno .
3747208Scael.Sh ERRORS
3847208ScaelThe
3947208Scael.Fn setgroups
4047208Scaelcall will fail if:
4147208Scael.Bl -tag -width Er
4247208Scael.It Bq Er EPERM
4320259SmckusickThe caller is not the super-user.
4447208Scael.It Bq Er EFAULT
4547208ScaelThe address specified for
4647208Scael.Fa gidset
4747208Scaelis outside the process
4820259Smckusickaddress space.
4947208Scael.El
5047208Scael.Sh SEE ALSO
5147208Scael.Xr getgroups 2 ,
5247208Scael.Xr initgroups 3
5347208Scael.Sh HISTORY
5447208ScaelThe
5547208Scael.Nm
5647208Scaelfunction call appeared in
5747208Scael.Bx 4.2 .
58