Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

OSS Library Calls (g - h) getgrgid(3)
};
The gr_passwd field is provided for compatibility with some versions of UNIX, but it always
contains a null string.
NOTES
The data returned by the getgrgid( ) function is stored in a thread-specic area and is overwritten
on subsequent calls to the getgrgid( ) or getgrnam( ) function. An application should not rely on
the data elds being stored contiguously. If the data must be reused, each string should be
separately copied before any other function that uses the static area is called.
To check for an error resulting from a call to getgrgid( ), set errno to 0 (zero) before the call.
RETURN VALUES
Upon successful completion, the getgrgid( ) function returns a pointer to a thread-specific global
group structure. Otherwise, the function returns a null pointer and sets errno to indicate the
specific error.
ERRORS
If any of the following conditions occurs, the getgrgid( ) function sets errno to the correspond-
ing value:
[EAGAIN] A system resource is temporarily unavailable. The function cannot allocate
sufcient heap space to complete the call.
[EINVAL] The value specified for the gid parameter is outside the range of valid values for
group IDs, or the value could not be passed in the call for other reasons.
[EIO] A disk process or file system input or output error occurred. Data might have
been lost during the transfer.
[ENOCRE] The calling process does not use the Common Run-Time Environment (CRE)
but requested a service that requires CRE (the static area cannot be allocated in
the calling process).
[ENOENT] The specified group ID does not exist, or the gid parameter contains an empty
string.
[ENOMEM] There is insufficient user memory to complete the call.
RELATED INFORMATION
Functions: getgrnam(3), getpwent(3).
STANDARDS CONFORMANCE
The HP implementation of this function does not return the following errno values defined in the
XPG4 Version 2 specification, because these conditions cannot occur in the HP implementation.
[EINTR], [EMFILE], or [ENFILE]
The following are HP extensions to the XPG4 Version 2 specification:
The errno values [EAGAIN], [EINVAL], [ENOCRE], [ENOENT], and [ENOMEM] can
be returned.
527187-017 Hewlett-Packard Company 341