2 .\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
3 .\" Copyright 1989 AT&T
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH GETGROUPS 2 "Sep 8, 2006"
9 getgroups, setgroups \- get or set supplementary group access list IDs
15 \fBint\fR \fBgetgroups\fR(\fBint\fR \fIgidsetsize\fR, \fBgid_t *\fR\fIgrouplist\fR);
20 \fBint\fR \fBsetgroups\fR(\fBint\fR \fIngroups\fR, \fBconst gid_t *\fR\fIgrouplist\fR);
26 The \fBgetgroups()\fR function gets the current supplemental group access list
27 of the calling process and stores the result in the array of group IDs
28 specified by \fIgrouplist\fR. This array has \fIgidsetsize\fR entries and must
29 be large enough to contain the entire list. This list cannot be larger than
30 \fBNGROUPS_UMAX\fR. If \fIgidsetsize\fR equals 0, \fBgetgroups()\fR will return
31 the number of groups to which the calling process belongs without modifying the
32 array pointed to by \fIgrouplist\fR.
35 The \fBsetgroups()\fR function sets the supplementary group access list of the
36 calling process from the array of group IDs specified by \fIgrouplist\fR. The
37 number of entries is specified by \fIngroups\fR and can not be greater than
42 Upon successful completion, \fBgetgroups()\fR returns the number of
43 supplementary group IDs set for the calling process and \fBsetgroups()\fR
44 returns \fB0\fR. Otherwise, \fB\(mi1\fR is returned and \fBerrno\fR is set to
49 The \fBgetgroups()\fR and \fBsetgroups()\fR functions will fail if:
56 A referenced part of the array pointed to by \fIgrouplist\fR is an illegal
62 The \fBgetgroups()\fR function will fail if:
69 The value of \fIgidsetsize\fR is non-zero and less than the number of
70 supplementary group IDs set for the calling process.
75 The \fBsetgroups()\fR function will fail if:
82 The value of \fIngroups\fR is greater than {\fBNGROUPS_MAX\fR}.
91 The {\fBPRIV_PROC_SETID\fR} privilege is not asserted in the effective set of
98 Use of the \fBsetgroups()\fR function requires the {\fBPRIV_PROC_SETID\fR}
103 See \fBattributes\fR(5) for descriptions of the following attributes:
111 ATTRIBUTE TYPE ATTRIBUTE VALUE
113 Interface Stability \fBgetgroups()\fR is Standard.
115 MT-Level Async-Signal-Safe
121 \fBgroups\fR(1), \fBchown\fR(2), \fBgetuid\fR(2), \fBsetuid\fR(2),
122 \fBgetgrnam\fR(3C), \fBinitgroups\fR(3C), \fBattributes\fR(5),
123 \fBprivileges\fR(5), \fBstandards\fR(5)