endservent()--Close Service Database
Syntax
#include <netdb.h> void endservent()
Service Program Name: QSOSRV1
Default Public Authority: *USE
Threadsafe: No; see Usage Notes.
The endservent() function is used to close the services database file. The file is opened by those functions that retrieve information about services (for example, getservent()).
Authorities
No authorization is required.
Usage Notes
- When the _XOPEN_SOURCE
macro defined to the value 520 or greater, the services file is always closed.
When the _XOPEN_SOURCE macro is not so defined, the services file is not closed if a setservent()
with a nonzero parameter value was previously completed.
- System i® Navigator or the
following CL commands can be
used to access the services database file:
- WRKSRVTBLE (Work with Service Table Entries)
- ADDSRVTBLE (Add Service Table Entry)
- RMVSRVTBLE (Remove Service Table Entry)
- WRKSRVTBLE (Work with Service Table Entries)
- Do not use the endservent() function in a multithreaded
environment. See the multithread alternative endservent_r()
function.
- 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 endservent() API is mapped to qso_endservent98().
Related Information
- _XOPEN_SOURCE--Using _XOPEN_SOURCE for the UNIX® 98
compatible interface
- getservent()--Get Next Entry from Service
Database
- setservent()--Open Service Database
- getservbyname()--Get Port Number for Service
Name
- getservbyport()--Get Service Name for Port Number
API introduced: V3R1