2 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\" References consulted:
7 .\" Linux libc source code
8 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
10 .\" Modified 1993-07-24 by Rik Faith <faith@cs.unc.edu>
11 .\" Modified 2004-10-10 by aeb
13 .TH initgroups 3 (date) "Linux man-pages (unreleased)"
15 initgroups \- initialize the supplementary group access list
18 .RI ( libc ", " \-lc )
21 .B #include <sys/types.h>
24 .BI "int initgroups(const char *" user ", gid_t " group );
28 Feature Test Macro Requirements for glibc (see
29 .BR feature_test_macros (7)):
36 glibc 2.19 and earlier:
42 function initializes the group access list by
43 reading the group database
45 and using all groups of
52 also added to the list.
56 argument must be non-NULL.
60 function returns 0 on success.
61 On error, \-1 is returned, and
63 is set to indicate the error.
67 Insufficient memory to allocate group information structure.
70 The calling process has insufficient privilege.
71 See the underlying system call
78 For an explanation of the terms used in this section, see
86 Interface Attribute Value
89 T} Thread safety MT-Safe locale