Commit | Line | Data |
---|---|---|
88b3ccf2 KB |
1 | .\" Copyright (c) 1983 The Regents of the University of California. |
2 | .\" All rights reserved. | |
87e80ad5 | 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 | .\" @(#)getgroups.2 6.5 (Berkeley) %G% | |
87e80ad5 | 17 | .\" |
66f6f7d0 | 18 | .TH GETGROUPS 2 "" |
87e80ad5 KM |
19 | .UC 5 |
20 | .SH NAME | |
21 | getgroups \- get group access list | |
22 | .SH SYNOPSIS | |
23 | .nf | |
24 | .ft B | |
25 | #include <sys/param.h> | |
26 | .PP | |
27 | .ft B | |
66f6f7d0 KM |
28 | ngroups = getgroups(gidsetlen, gidset) |
29 | int ngroups, gidsetlen, *gidset; | |
87e80ad5 KM |
30 | .fi |
31 | .SH DESCRIPTION | |
32 | .I Getgroups | |
33 | gets the current group access list of the user process | |
34 | and stores it in the array | |
35 | .IR gidset . | |
36 | The parameter | |
66f6f7d0 | 37 | .I gidsetlen |
214b5721 | 38 | indicates the number of entries that may be placed in |
66f6f7d0 KM |
39 | .IR gidset. |
40 | .I Getgroups | |
41 | returns the actual number of groups returned in | |
42 | .IR gidset . | |
43 | No more than NGROUPS, as defined in | |
87e80ad5 KM |
44 | .RI < sys/param.h >, |
45 | will ever | |
46 | be returned. | |
47 | .SH "RETURN VALUE | |
66f6f7d0 | 48 | A successful call returns the number of groups in the group set. |
87e80ad5 KM |
49 | A value of \-1 indicates that an error occurred, and the error |
50 | code is stored in the global variable \fIerrno\fP\|. | |
51 | .SH "ERRORS | |
52 | The possible errors for \fIgetgroup\fP are: | |
53 | .TP 15 | |
66f6f7d0 KM |
54 | [EINVAL] |
55 | The argument | |
56 | .I gidsetlen | |
57 | is smaller than the number of groups in the group set. | |
58 | .TP | |
87e80ad5 | 59 | [EFAULT] |
66f6f7d0 KM |
60 | The argument \fIgidset\fP specifies |
61 | an invalid address. | |
87e80ad5 | 62 | .SH "SEE ALSO |
01c39a64 | 63 | setgroups(2), initgroups(3) |
7f398d2d MK |
64 | .SH BUGS |
65 | The | |
66 | .I gidset | |
67 | array should be of type | |
68 | .BR gid_t , | |
69 | but remains integer for compatibility with earlier systems. |