setnetent() — Open the network information data set

Standards

Standards / Extensions C or C++ Dependencies

XPG4.2
Single UNIX Specification, Version 3

both  

Format

X/Open:
#define _XOPEN_SOURCE_EXTENDED 1
#include <netdb.h>

void setnetent(int stayopen);
Berkeley sockets:
#define _OE_SOCKETS
#include <netdb.h>

void setnetent(int stayopen);

General description

The setnetent() function opens and rewinds the tcpip.HOSTS.ADDRINFO data set, which contains information about known networks. If the stayopen flag is nonzero, the tcpip.HOSTS.ADDRINFO remains open after each call to setnetent().

You can use the X_ADDR environment variable to specify a data set other than tcpip.HOSTS.ADDRINFO.
Note: For more information on these data sets and environment variables, tcpip.HOSTS.ADDRINFO, see z/OS V2R1.0 Communications Server: IP Configuration Guide.

Special behavior for C++: To use this function with C++, you must use the _XOPEN_SOURCE_EXTENDED 1 feature test macro.

Returned value

setnetent() returns no values.

Related information