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

getgrent(3) Guardian Native C Library Calls Reference Manual
NOTES
The data returned by the getgrent() function is stored in a static area and is overwritten on sub-
sequent calls to the getgrent() function. If the data needs to be saved, it must be copied. Each
string pointed to by a char * eld of the group structure must be copied separately; an applica-
tion should not assume that the strings are contiguously located within the structure.
The functions getgrnam() and getgrgid() should be used instead of this function, to ensure por-
tability to future systems.
RETURN VALUES
Upon successful completion, the getgrent() 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 getgrent() function sets errno to the correspond-
ing value:
[EAGAIN] The system was unable to allocate sufcient user heap space to complete the
requested operation. Any list of usernames returned by the call might be trun-
cated. The call should be reissued to obtain correct data.
[EIO] A disk process or le system input/output error occurred. Data might have been
lost during the transfer.
[EMFILE] The system limit for open le descriptors per process has already reached the
maximum permitted.
[ENOENT] No more group records exist to be returned.
[ENOMEM] The system was unable to allocate sufcient memory for a control block.
[EWRONGID] The processor for the disk process that provides access to the database failed
during the input operation and takeover by the backup process occurred. The
operation can be tried again.
RELATED INFORMATION
Functions: endgrent(3), getgrgid(3), getgrnam(3), setgrent(3).
STANDARDS CONFORMANCE
The HP implementation of this function does not return the following errno values dened in the
XPG4 Version 2 specication, because the HP implementation does not allow that event to
occur.
[EINTR] or [ENFILE]
The following are HP extensions to the XPG4 Version 2 specication:
The errno values [EAGAIN], [ENOENT], [ENOMEM], and [EWRONGID] can be
returned.
318 Hewlett-Packard Company 527192-007