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