Open System Services Library Calls Reference Manual (G06.28+, H06.05+)

OSS Library Calls (g - h) getservent(3)
NAME
getservent - Gets the next entry from the network services database
LIBRARY
G-series native OSS processes: /G/system/sysnn/zinetsrl
H-series OSS processes: /G/system/zdllnnn/zinetdll
SYNOPSIS
#include <netdb.h>
struct servent *getservent(void);
PARAMETERS
None.
DESCRIPTION
The getservent() (get service entry) function reads the next line of the /etc/services le.
The getservent() function returns a pointer to a servent structure, which contains elds for a line
of information from the /etc/services le. The servent structure is dened in the netdb.h header
le.
NOTES
The getservent() return value points to static data, which is overwritten by any calls to get-
servbyport(), getservbyname( ), tservent(),orsetservent().
RETURN VALUES
Upon successful completion, the getservent() function returns a pointer to a servent structure.
If an error occurs or the end of the le is reached, the getservent() function returns a null pointer.
ERRORS
The getservent() function does not set errno.
FILES
/etc/services The Internet network service name database le. Each record in the le occupies
a single line and has four elds: the ofcial service name, the port number, the
protocol name, and aliases.
RELATED INFORMATION
Functions: getservbyport(3), getservbyname(3), endservent(3), setservent(3).
Files: services(4).
527187-007 Hewlett-Packard Company 375