endservent(3) — Subroutines
NAME
endservent, endservent_r − Close the /etc/services file.
LIBRARY
Standard C Library (libc.a)
SYNOPSIS
#include <netdb.h> void endservent(void); void endservent_r(
struct servent_data ∗serv_data);
PARAMETERS
serv_dataIs data for services’ database.
DESCRIPTION
The endservent() function closes the /etc/services file, previously opened with the getservent(), getservbyname(), or getsrvbyport function.
The endservent_r() function is the reentrant version of the endservent() function. The netdb.h header file defines the servent_data structure.
The system searches either the local /etc/services file or the NIS distributed networks file for the requested information. To determine which file or files to search, and in which order, the system uses the switches in the /etc/svc.conf file.
NOTES
If the most recent setservent() function was performed with a nonzero parameter, a subsequent endservent() function will not close the /etc/services file.
ERRORS
If the endservent_r() function fails, errno may be set to:
EINVALIf serv_data is NULL.
FILES
/etc/services
Contains service names.
RELATED INFORMATION
Functions: getservent(3), getservbyname(3), getservbyport(3), setservent(3).