Commit | Line | Data |
---|---|---|
931b8415 | 1 | .\" Copyright (c) 1983, 1991 The Regents of the University of California. |
88b3ccf2 | 2 | .\" All rights reserved. |
87e80ad5 | 3 | .\" |
91cff1e1 | 4 | .\" %sccs.include.redist.man% |
88b3ccf2 | 5 | .\" |
931b8415 | 6 | .\" @(#)getgroups.2 6.7 (Berkeley) %G% |
87e80ad5 | 7 | .\" |
931b8415 CL |
8 | .Dd |
9 | .Dt GETGROUPS 2 | |
10 | .Os BSD 4.2 | |
11 | .Sh NAME | |
12 | .Nm getgroups | |
13 | .Nd get group access list | |
14 | .Sh SYNOPSIS | |
15 | .Fd #include <sys/param.h> | |
16 | .Fd #include <unistd.h> | |
17 | .Ft int | |
18 | .Fn getgroups "int gidsetlen" "int *gidset" | |
19 | .Sh DESCRIPTION | |
20 | .Fn Getgroups | |
87e80ad5 KM |
21 | gets the current group access list of the user process |
22 | and stores it in the array | |
931b8415 | 23 | .Fa gidset . |
87e80ad5 | 24 | The parameter |
931b8415 | 25 | .Fa gidsetlen |
214b5721 | 26 | indicates the number of entries that may be placed in |
931b8415 CL |
27 | .Fa gidset . |
28 | .Fn Getgroups | |
66f6f7d0 | 29 | returns the actual number of groups returned in |
931b8415 CL |
30 | .Fa gidset . |
31 | No more than | |
32 | .Dv NGROUPS , | |
33 | as defined in | |
34 | .Aq Pa sys/param.h , | |
87e80ad5 KM |
35 | will ever |
36 | be returned. | |
931b8415 | 37 | .Sh RETURN VALUES |
66f6f7d0 | 38 | A successful call returns the number of groups in the group set. |
931b8415 CL |
39 | A value of -1 indicates that an error occurred, and the error |
40 | code is stored in the global variable | |
41 | .Va errno . | |
42 | .Sh ERRORS | |
43 | The possible errors for | |
44 | .Fn getgroups | |
45 | are: | |
46 | .Bl -tag -width Er | |
47 | .It Bq Er EINVAL | |
66f6f7d0 | 48 | The argument |
931b8415 | 49 | .Fa gidsetlen |
66f6f7d0 | 50 | is smaller than the number of groups in the group set. |
931b8415 CL |
51 | .It Bq Er EFAULT |
52 | The argument | |
53 | .Fa gidset | |
54 | specifies | |
66f6f7d0 | 55 | an invalid address. |
931b8415 CL |
56 | .El |
57 | .Sh SEE ALSO | |
58 | .Xr setgroups 2 , | |
59 | .Xr initgroups 3 | |
60 | .Sh BUGS | |
7f398d2d | 61 | The |
931b8415 | 62 | .Fa gidset |
7f398d2d | 63 | array should be of type |
931b8415 | 64 | .Vt gid_t , |
7f398d2d | 65 | but remains integer for compatibility with earlier systems. |
931b8415 CL |
66 | .Sh HISTORY |
67 | The | |
68 | .Nm | |
69 | function call appeared in | |
70 | .Bx 4.2 . |