.\" Modified Mon Apr 22 01:50:54 1996 by Martin Schulze <joey@infodrom.north.de>
.\" 2001-07-25 added a clause about NULL proto (Martin Michlmayr or David N. Welton)
.\"
-.TH GETSERVENT 3 2008-08-19 "GNU" "Linux Programmer's Manual"
+.TH GETSERVENT 3 2017-09-15 "GNU" "Linux Programmer's Manual"
.SH NAME
getservent, getservbyname, getservbyport, setservent, endservent \-
get service entry
.SH SYNOPSIS
.nf
.B #include <netdb.h>
-.sp
+.PP
.B struct servent *getservent(void);
-.sp
+.PP
.BI "struct servent *getservbyname(const char *" name ", const char *" proto );
-.sp
+.PP
.BI "struct servent *getservbyport(int " port ", const char *" proto );
-.sp
+.PP
.BI "void setservent(int " stayopen );
-.sp
+.PP
.B void endservent(void);
.fi
.SH DESCRIPTION
structure is defined in
.I <netdb.h>
as follows:
-.sp
+.PP
.in +4n
-.nf
+.EX
struct servent {
char *s_name; /* official service name */
char **s_aliases; /* alias list */
int s_port; /* port number */
char *s_proto; /* protocol to use */
}
-.fi
+.EE
.in
.PP
The members of the
locale
T}
.TE
-
+.sp 1
In the above table,
.I servent
in
.I race:servent
signifies that if any of the functions
-.BR setservent (3),
-.BR getservent (3),
+.BR setservent (),
+.BR getservent (),
or
-.BR endservent (3)
+.BR endservent ()
are used in parallel in different threads of a program,
then data races could occur.
.SH CONFORMING TO
-4.3BSD, POSIX.1-2001.
+POSIX.1-2001, POSIX.1-2008, 4.3BSD.
.SH SEE ALSO
.BR getnetent (3),
.BR getprotoent (3),