Open System Services System Calls Reference Manual (G06.28+, H06.05+)

getgrent_r(2) OSS System Calls Reference Manual
The gr_passwd eld is provided for compatibility with some versions of UNIX, but it always
contains a null string.
NOTES
Use the functions getgrnam_r() and getgrgid_r() instead of this function to ensure portability
to future systems.
RETURN VALUES
The getgrent_r() function returns a pointer to a struct group if it successfully enumerates an
entry; otherwise, it returns a null pointer and sets errno to indicate the specic error. When the
pointer returned by the function is nonnull, it is always equal to the grp pointer that was supplied
by the caller.
ERRORS
If any of these conditions occur, the getgrent_r() function sets errno to the corresponding
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. Reissue the call 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.
[ERANGE] Insufcient storage was supplied via buffer and buen to contain the data to be
referenced by the resulting group structure.
[EWRONGID] The processor for the disk process that provides access to the database failed
during the input operation and the backup process took over. Try the operation
again.
RELATED INFORMATION
Functions: endgrent(3), getgrent(3), getgrgid(3), getgrgid_r(2), getgrnam(3), getgrnam_r(2),
setgrent(3).
STANDARDS CONFORMANCE
This function is an extension to the UNIX98 specication. Interfaces documented on this refer-
ence page conform to the following industry standards:
IEEE Std 1003.1c-1995, POSIX System Application Program Interface
The use of the header le spthread.h is an HP exception to the POSIX standard.
368 Hewlett-Packard Company 527186-007