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

gethostent_r(2) OSS System Calls Reference Manual
NAME
gethostent_r - Gets the next entry in the network host database (reentrant)
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
[#include <netdb.h>]
#include <spthread.h>
struct hostent *gethostent_r (
struct hostent *host,
char *buffer,
int buen,
int *h_errnop
);
PARAMETERS
host Points to a struct hostent structure allocated by the caller.
buffer Points to the buffer supplied by the caller and used as a storage space for host
data.
buflen Species the size of the buffer passed in bytes.
h_errnop Points to the global integer h_errno to indicate the error code if an error occurs.
See the ERRORS subsection of this reference page for possible values.
DESCRIPTION
The gethostent_r() function is the reentrant version of the gethostent() function.
The gethostent_r() function retrieves the next entry in /etc/hosts, the network host database.
This function updates the hostent structure pointed to by the host parameter. Storage referenced
by the hostent structure is allocated from the memory provided with the buffer parameter, which
is buen characters in size. The h_errnop parameter is updated with the h_errno value if an
error occurs.
RETURN VALUES
On successful completion, gethostent_r() returns a pointer to a hostent structure if the entry was
found, and a null pointer if the end of the database was reached. If the call to gethostent_r( )
fails, a null pointer is returned.
ERRORS
If any of the following conditions occurs, the gethostent_r() function sets h_errno to the value
that corresponds to the condition:
HOST_NOT_FOUND
The name you have used is not a valid hostname or alias. This is not a soft error;
another type of name server request might be successful.
TRY_AGAIN An error occurred that might have been caused by a transient condition. A retry
at some later time might be successful.
NO_RECOVERY
This is a nonrecoverable error.
358 Hewlett-Packard Company 527186-005