Commit | Line | Data |
---|---|---|
931b8415 | 1 | .\" Copyright (c) 1983, 1991 The Regents of the University of California. |
88b3ccf2 | 2 | .\" All rights reserved. |
349834c5 | 3 | .\" |
91cff1e1 | 4 | .\" %sccs.include.redist.man% |
88b3ccf2 | 5 | .\" |
931b8415 | 6 | .\" @(#)setgroups.2 6.7 (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 |
21 | sets the group access list of the current user process |
22 | according to the array | |
931b8415 | 23 | .Fa gidset . |
349834c5 | 24 | The parameter |
931b8415 | 25 | .Fa ngroups |
349834c5 | 26 | indicates the number of entries in the array and must be no |
931b8415 CL |
27 | more than |
28 | .Dv NGROUPS , | |
29 | as defined in | |
30 | .Ao Pa sys/param.h Ac . | |
31 | .Pp | |
349834c5 | 32 | Only the super-user may set new groups. |
931b8415 CL |
33 | .Sh RETURN VALUES |
34 | A 0 value is returned on success, -1 on error, with | |
35 | an error code stored in | |
36 | .Va errno . | |
37 | .Sh ERRORS | |
38 | The | |
39 | .Fn setgroups | |
40 | call will fail if: | |
41 | .Bl -tag -width Er | |
42 | .It Bq Er EPERM | |
349834c5 | 43 | The caller is not the super-user. |
931b8415 CL |
44 | .It Bq Er EFAULT |
45 | The address specified for | |
46 | .Fa gidset | |
47 | is outside the process | |
349834c5 | 48 | address space. |
931b8415 CL |
49 | .El |
50 | .Sh SEE ALSO | |
51 | .Xr getgroups 2 , | |
52 | .Xr initgroups 3 | |
53 | .Sh BUGS | |
7f398d2d | 54 | The |
931b8415 | 55 | .Fa gidset |
7f398d2d | 56 | array should be of type |
931b8415 | 57 | .Em gid_t , |
7f398d2d | 58 | but remains integer for compatibility with earlier systems. |
931b8415 CL |
59 | .Sh HISTORY |
60 | The | |
61 | .Nm | |
62 | function call appeared in | |
63 | .Bx 4.2 . |