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

  1. System i® Navigator or the following CL commands can be used to access the protocol database file:


  2. Do not use the setprotoent() function in a multithreaded environment. See the multithread alternative setprotoent_r() function.

  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 setprotoent() API is mapped to qso_setprotoent98().

Related Information



API introduced: V4R2

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