endprotoent_r()--Close Protocol Database


  Syntax
 #include <netdb.h>
 int endprotoent_r(struct protoent_data
                   *protoent_data_struct_addr)

  Service Program Name: QSOSRV2

  Default Public Authority: *USE

  Threadsafe: Yes

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

Parameters

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

Authorities

No authorization is required.


Return Value

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

The struct protoent_data denoted by protoent_data_struct_addr is defined in <netdb.h>.


Error Conditions

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

[EINVAL]

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


Usage Notes

  1. When the _XOPEN_SOURCE macro defined to the value 520 or greater, the protocols file is always closed. When the _XOPEN_SOURCE macro is not so defined, the protocols file will not be closed if a setprotoent_r() call with a non-zero parameter value was previously done.

  2. System i® Navigator or the following CL commands can be used to access the protocol 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 endprotoent_r() API is mapped to qso_endprotoent_r98().

Related Information



API introduced: V4R2

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