endnetent_r()--Close Network Database


  Syntax
 #include <netdb.h>
 int endnetent_r(struct netent_data
                *netent_data_struct_addr)

  Service Program Name: QSOSRV2

  Default Public Authority: *USE

  Threadsafe: Yes

The endnetent_r() function is used to close the network database file. The file is opened by those functions that retrieve information about a network (for example, getnetent_r()).

Parameters

struct netent_data *netent_data_struct_addr  (input) 
Specifies the pointer to the netent_data structure, which is used to pass and preserve results between function calls. The field net_control_blk in the netent_data structure must be initialized with hexadecimal zeros before its initial use. If compatibility with other platforms is required, then the entire netent_data structure must be initialized with hexadecimal zeros before initial use.

Authorities

No authorization is required.


Return Value

The endnetent_r() function returns an integer. Possible values are:


Error Conditions

When the endnetent_r() function fails, errno can be set to:

[EINVAL]

The netent_data structure was not properly initialized to hexadecimal zeros before initial use. For corrective action, see the description for structure netent_data.


Usage Notes

  1. When the _XOPEN_SOURCE macro defined to the value 520 or greater, the network file is always closed. When the _XOPEN_SOURCE macro is not so defined, the network file will not be closed if a setnetent_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 network database file:


  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 endnetent_r() API is mapped toqso_endnetent_r98().


Related Information



API introduced: V4R2

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