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