Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/i/initgroups.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/i/initgroups.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/i/initgroups.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/i/initgroups.html on line 8

initgroups()

Initialize the supplementary group access list

Synopsis:

#include <grp.h>
#include <sys/types.h>

int initgroups( const char * name,
                gid_t basegid );

Arguments:

name
The name of the user whose group membership you want to use as the supplementary group access list.
basegid
A group ID that you want to include in the group access list.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The initgroups() function reads the group membership for the user specified by name from the group database, and then initializes the supplementary group access list of the calling process (see getgrnam() and getgroups()).

If the number of groups in the supplementary access list exceeds NGROUPS_MAX, the extra groups are ignored.

Returns:

0
Success.
-1
An error occurred (errno is set).

Errors:

EPERM
The caller isn't root.

Files:

/etc/group
The group database.

Classification:

Unix

Safety:
Cancellation point No
Interrupt handler No
Signal handler No
Thread No

Caveats:

If initgroups() fails, it doesn't change the supplementary group access list.

The getgrouplist() function called by initgroups() is based on getgrent(). If the calling process uses getgrent(), the in-memory group structure is overwritten in the call to initgroups().

See also:

getgroups(), getgrnam()


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/i/initgroups.html on line 171

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/i/initgroups.html on line 171