Open System Services System Calls Reference Manual (G06.28+)
System Functions (f - i) gethostbyname_r(2)
RETURN VALUES
Upon successful completion, gethostbyname_r() returns a pointer to a hostent structure if the
entry was found, and a null pointer if the entry was not found. If the call to gethostbyname_r()
fails, a null pointer is returned.
ERRORS
If any of the following conditions occurs, the gethostbyname_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.
NO_DATA | NO_ADDRESS
The requested name is valid but no associated address was found. Another type
of name server request might succeed.
In addition, if the following condition occurs, the gethostbyname_r() function sets errno to the
corresponding value:
[ERANGE] Insufficient storage was supplied via buffer and buflen to contain the data to be
referenced by the resulting hostent structure.
RELATED INFORMATION
Functions: gethostbyaddr(3), gethostbyaddr_r(2), endhostent(3).
Files: hosts(4).
STANDARDS CONFORMANCE
This function is an extension to the UNIX98 specification. 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 file spthread.h is an HP exception to the POSIX standard.
527186-005 Hewlett-Packard Company 3−57