setnetent()--Open Network Database


  Syntax
 #include <netdb.h>

 void setnetent(int stay_open)

  Service Program Name: QSOSRV2

  Default Public Authority: *USE

  Threadsafe: No; see Usage Notes.

The setnetent() function is used to prepare for sequential access to the network database file. setnetent() 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 getnetbyname() and getnetbyaddr(). A nonzero value will result 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 network database file:


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

Related Information



API introduced: V4R2

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