Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)

getgrgid(3) Guardian Native C Library Calls Reference Manual
The gr_passwd eld 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 static area and is overwritten on sub-
sequent 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 static group structure.
Otherwise, the function returns a null pointer and sets errno to indicate the specic 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 specied 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 le 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 specied group ID does not exist, or the gid parameter contains an empty
string.
[ENOMEM] There is insufcient 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 dened in the
XPG4 Version 2 specication, because these conditions cannot occur in the HP implementation.
[EINTR], [EMFILE], or [ENFILE]
The following are HP extensions to the XPG4 Version 2 specication:
The errno values [EAGAIN], [EINVAL], [ENOCRE], [ENOENT], and [ENOMEM] can
be returned.
320 Hewlett-Packard Company 527192-005