Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
setprotoent(3) OSS Library Calls Reference Manual
NAME
setprotoent - Opens the protocols database /etc/protocols and sets the next entry to the first
entry in the database
LIBRARY
G-series native OSS processes: /G/system/sysnn/zinetsrl
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zinetdll |
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/yinetdll |
SYNOPSIS
[#include <sys/socket.h>]
#include <netdb.h>
void setprotoent(
int stay_open);
PARAMETERS
stay_open If the value of this parameter is non-zero, the network protocols database will not
be closed after calls to getprotobyname( ), getprotobynumber( ), getpro-
toent( ), or their reentrant versions.
DESCRIPTION
The setprotoent( ) (set protocol entry) function opens /etc/protocols, the network protocols data-
base, and sets the next entry marker to the first entry in the database.
In a threaded environment, the behavior of the application is undetermined if more than one
thread in application is calling different sequences of the setprotoent( ), getprotoent( ),
getprotoent_r( ), getprotobyname( ), getprotobyname_r( ), or endprotoent( ) functions.
RETURN VALUES
Upon successful completion, the setprotoent( ) function returns a value of 0 (zero). Otherwise it
returns a value of -1.
ERRORS
The setprotoent( ) function does not set errno.
FILES
/etc/protocols The Internet network protocols database file. Each record in the file occupies a
single line and has three fields: the protocol name, the protocol number, and pro-
tocol aliases.
RELATED INFORMATION
Functions: endprotoent(3), getprotobyname(3), getprotobynumber(3), getprotoent(3).
Files: protocols(4), thread_safety(5).
6−42 Hewlett-Packard Company 527187-017