.BR getservent ()
function reads the next entry from the services database (see
.BR services (5))
-and returns a \fIservent\fP structure containing
+and returns a
+.I servent
+structure containing
the broken-out fields from the entry.
A connection is opened to the database if necessary.
.PP
The
.BR getservbyname ()
-function returns a \fIservent\fP structure
+function returns a
+.I servent
+structure
for the entry from the database
-that matches the service \fIname\fP using protocol \fIproto\fP.
-If \fIproto\fP is NULL, any protocol will be matched.
+that matches the service
+.I name
+using protocol
+.IR proto .
+If
+.I proto
+is NULL, any protocol will be matched.
A connection is opened to the database if necessary.
.PP
The
.BR getservbyport ()
-function returns a \fIservent\fP structure
+function returns a
+.I servent
+structure
for the entry from the database
-that matches the port \fIport\fP (given in network byte order)
-using protocol \fIproto\fP.
-If \fIproto\fP is NULL, any protocol will be matched.
+that matches the port
+.I port
+(given in network byte order)
+using protocol
+.IR proto .
+If
+.I proto
+is NULL, any protocol will be matched.
A connection is opened to the database if necessary.
.PP
The
.BR setservent ()
function opens a connection to the database,
and sets the next entry to the first entry.
-If \fIstayopen\fP is nonzero,
+If
+.I stayopen
+is nonzero,
then the connection to the database
will not be closed between calls to one of the
.BR getserv* ()
.BR endservent ()
function closes the connection to the database.
.PP
-The \fIservent\fP structure is defined in \fI<netdb.h>\fP as follows:
+The
+.I servent
+structure is defined in
+.I <netdb.h>
+as follows:
.sp
.in +4n
.nf
.fi
.in
.PP
-The members of the \fIservent\fP structure are:
+The members of the
+.I servent
+structure are:
.TP
.I s_name
The official name of the service.
and
.BR getservbyport ()
functions return a pointer to a
-statically allocated \fIservent\fP structure, or a NULL pointer if an
+statically allocated
+.I servent
+structure, or a NULL pointer if an
error occurs or the end of the file is reached.
.SH FILES
.TP