.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by the University of
-.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\" SUCH DAMAGE.
.\"
.\" From: @(#)getservent.3 8.3 (Berkeley) 1/12/94
-.\" $FreeBSD: src/lib/libc/net/getservent.3,v 1.7.2.4 2001/08/17 15:42:38 ru Exp $
+.\" $FreeBSD: src/lib/libc/net/getservent.3,v 1.15 2007/01/09 00:28:02 imp Exp $
.\"
.Dd July 9, 1995
.Dt GETSERVENT 3
.Os
.Sh NAME
-.Nm endservent ,
-.Nm getservbyname ,
-.Nm getservbyport ,
.Nm getservent ,
-.Nm setservent
+.Nm getservbyport ,
+.Nm getservbyname ,
+.Nm setservent ,
+.Nm endservent
.Nd get service entry
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
-.Fd #include <netdb.h>
-.Ft void
-.Fo endservent
-.Fa void
-.Fc
+.In netdb.h
.Ft struct servent *
-.Fo getservbyname
-.Fa "const char *name"
-.Fa "const char *proto"
-.Fc
+.Fn getservent
.Ft struct servent *
-.Fo getservbyport
-.Fa "int port"
-.Fa "const char *proto"
-.Fc
+.Fn getservbyname "const char *name" "const char *proto"
.Ft struct servent *
-.Fo getservent
-.Fa void
-.Fc
+.Fn getservbyport "int port" "const char *proto"
+.Ft void
+.Fn setservent "int stayopen"
.Ft void
-.Fo setservent
-.Fa "int stayopen"
-.Fc
+.Fn endservent void
.Sh DESCRIPTION
The
.Fn getservent ,
The
.Fn setservent
function
-opens and rewinds the file. If the
+opens and rewinds the file.
+If the
.Fa stayopen
flag is non-zero,
the net data base will not be closed after each call to
functions appeared in
.Bx 4.2 .
.Sh BUGS
-These functions use static data storage;
+These functions use a thread-specific data storage;
if the data is needed for future use, it should be
copied before any subsequent calls overwrite it.
Expecting port numbers to fit in a 32 bit