setprotoent()--Open Protocol Database
Syntax
#include <netdb.h> void setprotoent(int stay_open)
Service Program Name: QSOSRV2
Default Public Authority: *USE
Threadsafe: No; see Usage Notes.
The setprotoent() function is used to prepare for sequential access to the protocol database file. setprotoent() opens the file and repositions the file marker to the beginning of the file.
Parameters
- stay_open
- (Input) A value that indicates whether to leave the database file open after each getprotobynumber() and getprotobyname(). A nonzero value results in the database file being left open.
Authorities
No authorization is required.
Usage Notes
- System i® Navigator or the
following CL commands can be used to access the protocol database file:
- WRKPCLTBLE (Work with Protocol Table Entries)
- ADDPCLTBLE (Add Protocol Table Entry)
- RMVPCLTBLE (Remove Protocol Table Entry)
- Do not use the setprotoent() function in a multithreaded
environment. See the multithread alternative setprotoent_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 setprotoent() API is mapped to qso_setprotoent98().
Related Information
- _XOPEN_SOURCE--Using _XOPEN_SOURCE for the UNIX® 98
compatible interface
- getprotobyname()--Get Protocol Information for
Protocol Name
- getprotobynumber()--Get Protocol Information for
Protocol Number
- getprotoent()--Get Next Entry from Protocol
Database
- endprotoent()--Close Protocol Database
API introduced: V4R2