setservent()--Open Service Database


  Syntax
 #include <netdb.h>

 void setservent(int stay_open)

  Service Program Name: QSOSRV2

  Default Public Authority: *USE

  Threadsafe: No; see Usage Notes.

The setservent() function is used to prepare for sequential access to the service database file. setservent() 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 getservbyname() and getservbyport(). A nonzero value results in the database file being left open.

Authorities

No authorization is required.


Usage Notes

  1. The iSeries Navigator or the following CL commands can be used to access the services database file:


  2. Do not use the setservent() function in a multithreaded environment. See the multithread alternative setservent_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 setservent() API is mapped to qso_setservent98().

Related Information



API introduced: V4R2
Top | UNIX-Type APIs | APIs by category