]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
s/rpc/RPC/.
authorMichael Kerrisk <mtk.manpages@gmail.com>
Wed, 13 Aug 2008 05:17:40 +0000 (05:17 +0000)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Wed, 13 Aug 2008 05:17:40 +0000 (05:17 +0000)
Rephrase description in terms of a database, rather than a file.
Note that each of the get*() functions opens a connection to
the database if necessary.
s/zero terminated list/NULL-terminated list/

man3/getservent.3

index b4dab2f221e1f4bfa10f477abb958500db2bd479..d895a2cbf3cb78850a07c556327cea393662ce50 100644 (file)
@@ -29,7 +29,7 @@
 .\" 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  2001-07-25 "GNU" "Linux Programmer's Manual"
+.TH GETSERVENT 3  2008-08-13 "GNU" "Linux Programmer's Manual"
 .SH NAME
 getservent, getservbyname, getservbyport, setservent, endservent \-
 get service entry
@@ -50,39 +50,42 @@ get service entry
 .SH DESCRIPTION
 The
 .BR getservent ()
-function reads the next line from the file
-\fI/etc/services\fP and returns a structure \fIservent\fP containing
-the broken out fields from the line.
-The \fI/etc/services\fP file
-is opened if necessary.
+function reads the next entry from the services database (see
+.BR services (5))
+and returns a \fIservent\fP 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
-for the line from \fI/etc/services\fP that matches the service
-\fIname\fP using protocol \fIproto\fP.
+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.
+A connection is opened to the database if necessary.
 .PP
 The
 .BR getservbyport ()
 function returns a \fIservent\fP structure
-for the line that matches the port \fIport\fP given in network byte order
+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.
+A connection is opened to the database if necessary.
 .PP
 The
 .BR setservent ()
-function opens and rewinds the
-\fI/etc/services\fP file.
-If \fIstayopen\fP is true (1), then the
-file will not be closed between calls to
-.BR getservbyname ()
-and
-.BR getservbyport ().
+function opens a connection to the database,
+and sets the next entry to the first entry.
+If \fIstayopen\fP is non-zero,
+then the connection to the database
+will not be closed between calls to one of the
+.BR getserv* ()
+functions.
 .PP
 The
 .BR endservent ()
-function closes \fI/etc/services\fP.
+function closes the connection to the database.
 .PP
 The \fIservent\fP structure is defined in \fI<netdb.h>\fP as follows:
 .sp
@@ -103,7 +106,7 @@ The members of the \fIservent\fP structure are:
 The official name of the service.
 .TP
 .I s_aliases
-A zero terminated list of alternative names for the service.
+A NULL-terminated list of alternative names for the service.
 .TP
 .I s_port
 The port number for the service given in network byte order.