]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/initgroups.3
fanotify_init.2, fanotify.7: Document FAN_REPORT_TID
[thirdparty/man-pages.git] / man3 / initgroups.3
CommitLineData
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.\"
4b8c67d9 32.TH INITGROUPS 3 2017-09-15 "GNU" "Linux Programmer's Manual"
fea681da
MK
33.SH NAME
34initgroups \- 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
44Feature 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
54The
55.BR initgroups ()
56function initializes the group access list by
c6fa0841
MK
57reading the group database
58.I /etc/group
59and using all groups of
60which
61.I user
62is a member.
63The additional group
64.I group
65is
fea681da 66also added to the list.
847e0d88 67.PP
fea681da
MK
68The
69.I user
70argument must be non-NULL.
47297adb 71.SH RETURN VALUE
60a90ecd
MK
72The
73.BR initgroups ()
74function returns 0 on success.
cca657e2
MK
75On error, \-1 is returned, and
76.I errno
77is set appropriately.
fea681da
MK
78.SH ERRORS
79.TP
80.B ENOMEM
81Insufficient memory to allocate group information structure.
82.TP
83.B EPERM
c13182ef
MK
84The calling process has insufficient privilege.
85See the underlying system call
fea681da
MK
86.BR setgroups (2).
87.SH FILES
a2d427c1
MK
88.TP
89.I /etc/group
90group database file
5baaaa1c
MS
91.SH ATTRIBUTES
92For an explanation of the terms used in this section, see
93.BR attributes (7).
94.TS
95allbox;
96lb lb lb
97l l l.
98Interface Attribute Value
99T{
100.BR initgroups ()
101T} Thread safety MT-Safe locale
102.TE
847e0d88 103.sp 1
47297adb 104.SH CONFORMING TO
44a2c328 105SVr4, 4.3BSD.
47297adb 106.SH SEE ALSO
fea681da 107.BR getgroups (2),
53a1443c
MK
108.BR setgroups (2),
109.BR credentials (7)