9103 opengroup acknowledgement should be properly formatted in man pages
[unleashed.git] / usr / src / man / man3c / initgroups.3c
blobf17f65c7b8ebd7253b2f893031c89b0e280b3147
1 '\" te
2 .\" Copyright 1989 AT&T.  Copyright (c) 2004, Sun Microsystems, Inc.  All Rights Reserved.
3 .\" 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.
4 .\" 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.
5 .\" 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]
6 .TH INITGROUPS 3C "Mar 22, 2004"
7 .SH NAME
8 initgroups \- initialize the supplementary group access list
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <grp.h>
13 #include <sys/types.h>
15 \fBint\fR \fBinitgroups\fR(\fBconst char *\fR\fIname\fR, \fBgid_t\fR \fIbasegid\fR);
16 .fi
18 .SH DESCRIPTION
19 .sp
20 .LP
21 The \fBinitgroups()\fR function reads the group database to get the group
22 membership for the user specified by \fIname\fR, and initializes the
23 supplementary group access list of the calling process (see \fBgetgrnam\fR(3C)
24 and \fBgetgroups\fR(2)). The \fIbasegid\fR group ID is also included in the
25 supplementary group access list. This is typically the real group ID from the
26 user database.
27 .sp
28 .LP
29 While scanning the group database, if the number of groups, including the
30 \fIbasegid\fR entry, exceeds \fBNGROUPS_MAX\fR, subsequent group entries are
31 ignored.
32 .SH RETURN VALUES
33 .sp
34 .LP
35 Upon successful completion, 0 is returned. Otherwise, \(mi1 is returned and
36 \fBerrno\fR is set to indicate the error.
37 .SH ERRORS
38 .sp
39 .LP
40 The \fBinitgroups()\fR function will fail and not change the supplementary
41 group access list if:
42 .sp
43 .ne 2
44 .na
45 \fB\fBEPERM\fR\fR
46 .ad
47 .RS 9n
48 The {\fBPRIV_PROC_SETID\fR} privilege is not asserted in the effective set of
49 the calling process.
50 .RE
52 .SH ATTRIBUTES
53 .sp
54 .LP
55 See \fBattributes\fR(5) for descriptions of the following attributes:
56 .sp
58 .sp
59 .TS
60 box;
61 c | c
62 l | l .
63 ATTRIBUTE TYPE  ATTRIBUTE VALUE
65 MT-Level        MT-Safe
66 .TE
68 .SH SEE ALSO
69 .sp
70 .LP
71 \fBgetgroups\fR(2), \fBgetgrnam\fR(3C), \fBattributes\fR(5)