Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
initgroups(3) OSS Library Calls Reference Manual
NAME
initgroups - Initializes the group list of the calling process
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsecsrl
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zsecdll |
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ysecdll |
SYNOPSIS
#include <sys/types.h> /* optional except for POSIX.1 */
#include <unistd.h>
int initgroups(
const char *name,
gid_t basegid);
PARAMETERS
name The username of the user whose group list this function will use to initialize the
group list of the calling process.
basegid The group ID that is to be included in the group list.
DESCRIPTION
The initgroups( ) function obtains the group access list of the user specified by the name parame-
ter and uses that list to set the group access list of the calling process. If the basegid parameter is
zero or positive, the initgroups( ) function adds the group ID specified by basegid to the group
access list of the calling process. The name parameter must not be NULL.
The calling process must have the appropriate privileges to use this function.
NOTES
This function is supported on systems running J06.07 and later J-series RVUs, H06.18 and later
H-series RVUs, and G06.33 and later G-series RVUs.
RETURN VALUES
Upon successful completion, the initgroups( ) function returns the value 0 (zero). Otherwise, the
value -1 is returned and errno is set to indicate the error.
ERRORS
If any of these conditions occur, the initgroups( ) function sets errno to the corresponding value:
[EINVAL] The value of basegid is not in the range of 0 (zero) through 65535 and the name
parameter does not specify a valid username.
[EPERM] The process lacks appropriate privileges.
RELATED INFORMATION
Functions: getgroups(2), setgroups(2).
STANDARDS CONFORMANCE
This function is an HP extension to the XPG4 Version 2 specification.
4−30 Hewlett-Packard Company 527187-017