Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
gethostbyname() z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference SC27-3660-00 |
|
The gethostbyname() call tries to resolve the host address to an IP address. The resolution attempted depends on how the resolver is configured and if any local host tables exist. If the symbol RESOLVE_VIA_LOOKUP is defined before including MANIFEST.H, gethostbyname() only uses local host tables and name servers are not used. See z/OS Communications Server: IP Configuration Guide for information about configuring the resolver and using local host tables.
The gethostbyname() call returns a pointer to a hostent structure for the host name specified on the call. The NETDB.H header file defines the hostent structure and contains the following elements:
Return valuesThe return value points to
static data that is overwritten by subsequent calls. A pointer to a hostent structure indicates success. A NULL pointer indicates an
error or EOF. When a NULL pointer or 0 is returned, the value of errno
is indeterminate, and, therefore, the output from a tcperror() call
is also not valid. Global variable h_errno identifies the specific
error.
Related callsgethostent(), sethostent(), endhostent() |
Copyright IBM Corporation 1990, 2014
|