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

System Functions (f - i) gethostbyaddr_r(2)
NOTES
Use the endhostent() function to close the /etc/hosts le.
RETURN VALUES
Upon successful completion of gethostbyaddr_r(), a pointer to a hostent structure is returned if
the address was found, and a null pointer if the address was not found. If the call to
gethostbyaddr_r() fails, a null pointer is returned.
ERRORS
If the gethostbyaddr_r() function fails, h_errno might be set to one of the following values:
HOST_NOT_FOUND
The name is not a valid hostname or alias. This is not a soft error; another type of
name server request might be successful.
NO_DATA | NO_ADDRESS
The address you used is not valid. This is not a soft error; another type of name
server request might be successful.
NO_RECOVERY
A server failure occurred. This is a nonrecoverable error.
TRY_AGAIN An error occurred that might have been caused by a transient condition. A later
retry might succeed.
Additionally, gethostbyaddr_r() might set errno to the following value:
[ERANGE] Insufcient storage was supplied via buffer and buen to contain the data to be
referenced by the resulting hostent structure.
FILES
/etc/hosts The Internet network hostname database.
/etc/resolv.conf
The resolver conguration le.
RELATED INFORMATION
Functions: gethostbyname(3), gethostbyname_r(2), endhostent(3), sethostent(3).
Files: hosts(4), resolv.conf(4), resolv.conf(5).
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.
527186-005 Hewlett-Packard Company 355