Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
getgrnam(3) Guardian Native C Library Calls Reference Manual
};
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 getgrnam() function is stored in a thread-specific area and is overwrit-
ten on subsequent calls to the getgrgid() or getgrnam() function. An application should not
rely on the data fields 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 getgrnam(), set errno to 0 (zero) before the call.
RETURN VALUES
Upon successful completion, the getgrnam() function returns a pointer to a thread-specific glo-
bal 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 getgrnam() function sets errno to the correspond-
ing value:
[EAGAIN] A system resource is temporarily unavailable. The function cannot allocate
sufficient heap space to complete the call.
[EINVAL] The value specified for the name parameter contains invalid characters or cannot
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.
[ENAMETOOLONG]
The value specified for the name parameter exceeds the maximum number of
characters allowed for a group name.
[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 name does not exist, or the name parameter points to an
empty string.
[ENOMEM] There is insufficient user memory to complete the call.
RELATED INFORMATION
Functions: getgrgid(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], [ENAMETOOLONG], [ENOCRE],
[ENOENT], and [ENOMEM] can be returned.
3−36 Hewlett-Packard Company 527192-018