fixed the under development line
[unix-history] / usr / src / lib / libc / sys / setgroups.2
CommitLineData
3f6f0ccf
KB
1.\" Copyright (c) 1983, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
349834c5 3.\"
91cff1e1 4.\" %sccs.include.redist.man%
88b3ccf2 5.\"
3f6f0ccf 6.\" @(#)setgroups.2 8.1 (Berkeley) %G%
349834c5 7.\"
931b8415
CL
8.Dd
9.Dt SETGROUPS 2
10.Os BSD 4.2
11.Sh NAME
12.Nm setgroups
13.Nd set group access list
14.Sh SYNOPSIS
15.Fd #include <unistd.h>
16.Fd #include <sys/param.h>
17.Ft int
18.Fn setgroups "int ngroups" "const int *gidset"
19.Sh DESCRIPTION
20.Fn Setgroups
349834c5
KM
21sets the group access list of the current user process
22according to the array
931b8415 23.Fa gidset .
349834c5 24The parameter
931b8415 25.Fa ngroups
349834c5 26indicates the number of entries in the array and must be no
931b8415
CL
27more than
28.Dv NGROUPS ,
29as defined in
30.Ao Pa sys/param.h Ac .
31.Pp
349834c5 32Only the super-user may set new groups.
931b8415
CL
33.Sh RETURN VALUES
34A 0 value is returned on success, -1 on error, with
35an error code stored in
36.Va errno .
37.Sh ERRORS
38The
39.Fn setgroups
40call will fail if:
41.Bl -tag -width Er
42.It Bq Er EPERM
349834c5 43The caller is not the super-user.
931b8415
CL
44.It Bq Er EFAULT
45The address specified for
46.Fa gidset
47is outside the process
349834c5 48address space.
931b8415
CL
49.El
50.Sh SEE ALSO
51.Xr getgroups 2 ,
52.Xr initgroups 3
53.Sh BUGS
7f398d2d 54The
931b8415 55.Fa gidset
7f398d2d 56array should be of type
931b8415 57.Em gid_t ,
7f398d2d 58but remains integer for compatibility with earlier systems.
931b8415
CL
59.Sh HISTORY
60The
61.Nm
62function call appeared in
63.Bx 4.2 .