Commit | Line | Data |
---|---|---|
87e80ad5 KM |
1 | .\" Copyright (c) 1983 Regents of the University of California. |
2 | .\" All rights reserved. The Berkeley software License Agreement | |
3 | .\" specifies the terms and conditions for redistribution. | |
4 | .\" | |
66f6f7d0 | 5 | .\" @(#)getgroups.2 6.1 (Berkeley) %G% |
87e80ad5 | 6 | .\" |
66f6f7d0 | 7 | .TH GETGROUPS 2 "" |
87e80ad5 KM |
8 | .UC 5 |
9 | .SH NAME | |
10 | getgroups \- get group access list | |
11 | .SH SYNOPSIS | |
12 | .nf | |
13 | .ft B | |
14 | #include <sys/param.h> | |
15 | .PP | |
16 | .ft B | |
66f6f7d0 KM |
17 | ngroups = getgroups(gidsetlen, gidset) |
18 | int ngroups, gidsetlen, *gidset; | |
87e80ad5 KM |
19 | .fi |
20 | .SH DESCRIPTION | |
21 | .I Getgroups | |
22 | gets the current group access list of the user process | |
23 | and stores it in the array | |
24 | .IR gidset . | |
25 | The parameter | |
66f6f7d0 | 26 | .I gidsetlen |
87e80ad5 | 27 | indicates the number of entries which may be placed in |
66f6f7d0 KM |
28 | .IR gidset. |
29 | .I Getgroups | |
30 | returns the actual number of groups returned in | |
31 | .IR gidset . | |
32 | No more than NGROUPS, as defined in | |
87e80ad5 KM |
33 | .RI < sys/param.h >, |
34 | will ever | |
35 | be returned. | |
36 | .SH "RETURN VALUE | |
66f6f7d0 | 37 | A successful call returns the number of groups in the group set. |
87e80ad5 KM |
38 | A value of \-1 indicates that an error occurred, and the error |
39 | code is stored in the global variable \fIerrno\fP\|. | |
40 | .SH "ERRORS | |
41 | The possible errors for \fIgetgroup\fP are: | |
42 | .TP 15 | |
66f6f7d0 KM |
43 | [EINVAL] |
44 | The argument | |
45 | .I gidsetlen | |
46 | is smaller than the number of groups in the group set. | |
47 | .TP | |
87e80ad5 | 48 | [EFAULT] |
66f6f7d0 KM |
49 | The argument \fIgidset\fP specifies |
50 | an invalid address. | |
87e80ad5 | 51 | .SH "SEE ALSO |
66f6f7d0 | 52 | setgroups(2), initgroups(3X) |