Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

OSS Library Calls (s) setservent(3)
NAME
setservent - Opens the network services database /etc/services and sets the next entry to the first
entry
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 setservent(
int stay_open);
PARAMETERS
stay_open If this parameter is set to a nonzero value, the network services database will not
be closed after calls to getservent( ), getservbyname( ), getservbyport(),or
their reentrant versions.
DESCRIPTION
The setservent() (set service entry) function opens the /etc/services file and sets the next entry
marker to the first entry in the file.
For enumeration in multithreaded applications, the position within the enumeration is a process-
wide property that is shared by all threads. When used in a multi-threaded application, the
setservent( ) function resets the enumeration position for all threads.
RETURN VALUES
Upon successful completion, the setservent( ) function returns a value of 0 (zero). Otherwise, it
returns a value of -1.
ERRORS
The setservent() function does not set errno.
FILES
/etc/services This is the Internet network service-name database. Each record in the file occu-
pies a single line and has four fields: the service name, the port reference, the
protocol name, and aliases.
RELATED INFORMATION
Functions: endservent(3), getservbyname(3), getservbyport(3), getservent(3), setprotoent(3).
Files: services(4), thread_safety(5).
527187-017 Hewlett-Packard Company 645