Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
Guardian Native C Library Calls (g - i) getgrent(3)
NOTES
The data returned by the getgrent() function is stored in a thread-specific area and is overwritten
on subsequent calls to the getgrent() function. If the data needs to be saved, it must be copied.
Each string pointed to by a char * field of the group structure must be copied separately; an
application 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 thread-specific global
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 getgrent() function sets errno to the correspond-
ing value:
[EAGAIN] The system was unable to allocate sufficient 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 file system input/output error occurred. Data might have been
lost during the transfer.
[EMFILE] The system limit for open file 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 sufficient 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 defined in the
XPG4 Version 2 specification, because the HP implementation does not allow that event to
occur.
• [EINTR] or [ENFILE]
The following are HP extensions to the XPG4 Version 2 specification:
• The errno values [EAGAIN], [ENOENT], [ENOMEM], and [EWRONGID] can be
returned.
527192-018 Hewlett-Packard Company 3−25