]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) |
2 | .\" | |
93015253 | 3 | .\" %%%LICENSE_START(VERBATIM) |
fea681da MK |
4 | .\" Permission is granted to make and distribute verbatim copies of this |
5 | .\" manual provided the copyright notice and this permission notice are | |
6 | .\" preserved on all copies. | |
7 | .\" | |
8 | .\" Permission is granted to copy and distribute modified versions of this | |
9 | .\" manual under the conditions for verbatim copying, provided that the | |
10 | .\" entire resulting derived work is distributed under the terms of a | |
11 | .\" permission notice identical to this one. | |
c13182ef | 12 | .\" |
fea681da MK |
13 | .\" Since the Linux kernel and libraries are constantly changing, this |
14 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
15 | .\" responsibility for errors or omissions, or for damages resulting from | |
16 | .\" the use of the information contained herein. The author(s) may not | |
17 | .\" have taken the same level of care in the production of this manual, | |
18 | .\" which is licensed free of charge, as they might when working | |
19 | .\" professionally. | |
c13182ef | 20 | .\" |
fea681da MK |
21 | .\" Formatted or processed versions of this manual, if unaccompanied by |
22 | .\" the source, must acknowledge the copyright and authors of this work. | |
4b72fb64 | 23 | .\" %%%LICENSE_END |
fea681da MK |
24 | .\" |
25 | .\" References consulted: | |
26 | .\" Linux libc source code | |
27 | .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) | |
28 | .\" 386BSD man pages | |
29 | .\" Modified 1993-07-24 by Rik Faith <faith@cs.unc.edu> | |
30 | .\" Modified 2004-10-10 by aeb | |
31 | .\" | |
97986708 | 32 | .TH INITGROUPS 3 2016-03-15 "GNU" "Linux Programmer's Manual" |
fea681da MK |
33 | .SH NAME |
34 | initgroups \- initialize the supplementary group access list | |
35 | .SH SYNOPSIS | |
36 | .nf | |
37 | .B #include <sys/types.h> | |
38 | .B #include <grp.h> | |
68e4db0a | 39 | .PP |
fea681da MK |
40 | .BI "int initgroups(const char *" user ", gid_t " group ); |
41 | .fi | |
68e4db0a | 42 | .PP |
cc4615cc MK |
43 | .in -4n |
44 | Feature Test Macro Requirements for glibc (see | |
45 | .BR feature_test_macros (7)): | |
46 | .in | |
68e4db0a | 47 | .PP |
cc4615cc | 48 | .BR initgroups (): |
51c612fb MK |
49 | Since glibc 2.19: |
50 | _DEFAULT_SOURCE | |
51 | Glibc 2.19 and earlier: | |
52 | _BSD_SOURCE | |
fea681da | 53 | .SH DESCRIPTION |
60a90ecd MK |
54 | The |
55 | .BR initgroups () | |
56 | function initializes the group access list by | |
c6fa0841 MK |
57 | reading the group database |
58 | .I /etc/group | |
59 | and using all groups of | |
60 | which | |
61 | .I user | |
62 | is a member. | |
63 | The additional group | |
64 | .I group | |
65 | is | |
fea681da MK |
66 | also added to the list. |
67 | ||
68 | The | |
69 | .I user | |
70 | argument must be non-NULL. | |
47297adb | 71 | .SH RETURN VALUE |
60a90ecd MK |
72 | The |
73 | .BR initgroups () | |
74 | function returns 0 on success. | |
cca657e2 MK |
75 | On error, \-1 is returned, and |
76 | .I errno | |
77 | is set appropriately. | |
fea681da MK |
78 | .SH ERRORS |
79 | .TP | |
80 | .B ENOMEM | |
81 | Insufficient memory to allocate group information structure. | |
82 | .TP | |
83 | .B EPERM | |
c13182ef MK |
84 | The calling process has insufficient privilege. |
85 | See the underlying system call | |
fea681da MK |
86 | .BR setgroups (2). |
87 | .SH FILES | |
88 | .nf | |
89 | \fI/etc/group\fP group database file | |
90 | .fi | |
5baaaa1c MS |
91 | .SH ATTRIBUTES |
92 | For an explanation of the terms used in this section, see | |
93 | .BR attributes (7). | |
94 | .TS | |
95 | allbox; | |
96 | lb lb lb | |
97 | l l l. | |
98 | Interface Attribute Value | |
99 | T{ | |
100 | .BR initgroups () | |
101 | T} Thread safety MT-Safe locale | |
102 | .TE | |
103 | ||
47297adb | 104 | .SH CONFORMING TO |
44a2c328 | 105 | SVr4, 4.3BSD. |
47297adb | 106 | .SH SEE ALSO |
fea681da | 107 | .BR getgroups (2), |
53a1443c MK |
108 | .BR setgroups (2), |
109 | .BR credentials (7) |