The endhostent_r() function is used to close the local host table. The table is opened by those functions that retrieve information about a
host (for example, gethostent_r()).
Specifies the pointer to the hostent_data structure, which is used to pass
and preserve results between function calls. The field host_control_blk in the
hostent_data structure must be initialized with hexadecimal zeros before its
initial use. If compatibility with other platforms is required, then the entire
hostent_data structure must be initialized to hexadecimal zeros before initial
use.
Authorities
No authorization is required.
Return Value
The endhostent_r() function returns an integer. Possible values
are:
-1 (unsuccessful call)
0 (successful call)
The struct hostent_datadenoted by
hostent_data_struct_addr is defined in
<netdb.h>.
Error Conditions
When the endhostent_r() function fails, errno can be set
to:
[EINVAL]
The hostent_data structure was not properly
initialized to hexadecimal zeros before initial use. For corrective action, see
the description for structure hostent_data.
Usage Notes
When the _XOPEN_SOURCE
macro defined to the value 520 or greater, the host table is always closed. When
the _XOPEN_SOURCE macro is not so defined, the host table will not be closed if a
sethostent_r() call with a nonzero parameter value was previously done.
System i® Navigator or the following CL commands can be
used to access the local host table:
ADDTCPHTE (Add TCP/IP Host Table Entry)
RMVTCPHTE (Remove TCP/IP Host Table Entry)
CHGTCPHTE (Change TCP/IP Host Table Entry)
RNMTCPHTE (Rename TCP/IP Host Table Entry)
MRGTCPHT (Merge TCP/IP Host Tables)
CFGTCP (Configure TCP/IP), option "10. Work with TCP/IP host table entries"
When you develop in C-based languages and an application is compiled with
the _XOPEN_SOURCE macro defined to the value 520 or greater, the endhostent_r()
API is mapped to qso_endhostent_r98().
Related Information
_XOPEN_SOURCE--Using _XOPEN_SOURCE for the UNIX® 98
compatible interface