Commit | Line | Data |
---|---|---|
88b3ccf2 KB |
1 | .\" Copyright (c) 1983 The Regents of the University of California. |
2 | .\" All rights reserved. | |
349834c5 | 3 | .\" |
88b3ccf2 KB |
4 | .\" Redistribution and use in source and binary forms are permitted |
5 | .\" provided that the above copyright notice and this paragraph are | |
6 | .\" duplicated in all such forms and that any documentation, | |
7 | .\" advertising materials, and other materials related to such | |
8 | .\" distribution and use acknowledge that the software was developed | |
9 | .\" by the University of California, Berkeley. The name of the | |
10 | .\" University may not be used to endorse or promote products derived | |
11 | .\" from this software without specific prior written permission. | |
12 | .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
13 | .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
14 | .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
15 | .\" | |
16 | .\" @(#)setgroups.2 6.5 (Berkeley) %G% | |
349834c5 | 17 | .\" |
10d611fe | 18 | .TH SETGROUPS 2 "" |
349834c5 KM |
19 | .UC 5 |
20 | .SH NAME | |
21 | setgroups \- set group access list | |
22 | .SH SYNOPSIS | |
23 | .nf | |
24 | .ft B | |
25 | #include <sys/param.h> | |
26 | .PP | |
27 | .ft B | |
28 | setgroups(ngroups, gidset) | |
29 | int ngroups, *gidset; | |
30 | .fi | |
31 | .SH DESCRIPTION | |
32 | .I Setgroups | |
33 | sets the group access list of the current user process | |
34 | according to the array | |
35 | .IR gidset . | |
36 | The parameter | |
37 | .I ngroups | |
38 | indicates the number of entries in the array and must be no | |
34517f62 | 39 | more than NGROUPS, as defined in |
349834c5 KM |
40 | .RI < sys/param.h >. |
41 | .PP | |
42 | Only the super-user may set new groups. | |
43 | .SH "RETURN VALUE | |
44 | A 0 value is returned on success, \-1 on error, with | |
45 | a error code stored in \fIerrno\fP. | |
46 | .SH "ERRORS | |
47 | The \fIsetgroups\fP call will fail if: | |
48 | .TP 15 | |
49 | [EPERM] | |
50 | The caller is not the super-user. | |
51 | .TP 15 | |
52 | [EFAULT] | |
53 | The address specified for \fIgidset\fP is outside the process | |
54 | address space. | |
55 | .SH "SEE ALSO | |
a81bfa3e | 56 | getgroups(2), initgroups(3) |
7f398d2d MK |
57 | .SH BUGS |
58 | The | |
59 | .I gidset | |
60 | array should be of type | |
61 | .BR gid_t , | |
62 | but remains integer for compatibility with earlier systems. |