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

getgrnam(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 getgrnam() 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 getgrnam(), set errno to 0 (zero) before the call.
RETURN VALUES
Upon successful completion, the getgrnam() function returns a pointer to a static group struc-
ture. Otherwise, the function returns a null pointer and sets errno to indicate the specic 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
sufcient heap space to complete the call.
[EINVAL] The value specied for the name parameter contains invalid characters or cannot
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.
[ENAMETOOLONG]
The value specied 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 specied group name does not exist, or the name parameter points to an
empty string.
[ENOMEM] There is insufcient 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 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], [ENAMETOOLONG], [ENOCRE],
[ENOENT], and [ENOMEM] can be returned.
322 Hewlett-Packard Company 527192-005