setprotoent() — Open the protocol 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 setprotoent(int stayopen);
Berkeley sockets:
#define _OE_SOCKETS
#include <netdb.h>

void setprotoent(int stayopen);

General description

The setprotoent() function opens and rewinds the /etc/protocol or the tcpip.ETC.PROTO data set. If the stayopen flag is nonzero, the /etc/protocol or the tcpip.ETC.PROTO data set remains open after each call.

Special behavior for C++

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

Returned value

setprotoent() returns no values.

Related information