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
- System i® Navigator or the following CL commands can be
used to access the network database file:
- WRKNETTBLE (Work with Network Table Entries)
- ADDNETTBLE (Add Network Table Entry)
- RMVNETTBLE (Remove Network Table Entry)
- Do not use the setnetent() function in a multithreaded
environment. See the multithread alternative setnetent_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 setnetent() API is mapped to qso_setnetent98().
Related Information
- _XOPEN_SOURCE--Using _XOPEN_SOURCE for the UNIX® 98
compatible interface
- getnetbyaddr()--Get Network Information for IP
Address
- getnetbyname()--Get Network Information for Domain
Name
- getnetent()--Get Next Entry from Network
Database
- endnetent()--Close Network Database
API introduced: V4R2