endhostent_r()--Close Local Host Table


  Syntax
 #include <netdb.h>

 void endhostent_r(struct hostent_data
                   *hostent_data_struct_addr)

  Service Program Name: QSOSRV2

  Default Public Authority: *USE

  Threadsafe: Yes

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()).

Parameters

struct hostent_data *hostent_data_struct_addr  (input) 
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:

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

  1. 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.

  2. System i® Navigator or the following CL commands can be used to access the local host table:



  3. 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



API introduced: V4R2

[ Back to top | UNIX-Type APIs | APIs by category ]