OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man3 / getservent_r.3
index e87e6c7..553f12f 100644 (file)
@@ -1,6 +1,7 @@
 .\" Copyright 2008, Linux Foundation, written by Michael Kerrisk
 .\"    <mtk.manpages@gmail.com>
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
@@ -20,8 +21,9 @@
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
-.TH GETSERVENT_R 3  2008-08-19 "GNU" "Linux Programmer's Manual"
+.TH GETSERVENT_R 3  2010-09-10 "GNU" "Linux Programmer's Manual"
 .SH NAME
 getservent_r, getservbyname_r, getservbyport_r \- get
 service entry (reentrant)
@@ -50,7 +52,9 @@ Feature Test Macro Requirements for glibc (see
 .BR getservent_r (),
 .BR getservbyname_r (),
 .BR getservbyport_r ():
+.RS 4
 _BSD_SOURCE || _SVID_SOURCE
+.RE
 .ad b
 .SH DESCRIPTION
 The
@@ -100,9 +104,9 @@ is set pointing to
 otherwise,
 .I *result
 is set to NULL.
-.SH "RETURN VALUE"
+.SH RETURN VALUE
 On success, these functions return 0.
-On error, a positive error number is returned.
+On error, they return one of the positive error numbers listed in errors.
 
 On error, record not found
 .RB ( getservbyname_r (),
@@ -123,7 +127,7 @@ is too small.
 Try again with a larger buffer
 (and increased
 .IR buflen ).
-.SH "CONFORMING TO"
+.SH CONFORMING TO
 These functions are GNU extensions.
 Functions with similar names exist on some other systems,
 though typically with different calling signatures.
@@ -177,13 +181,13 @@ main(int argc, char *argv[])
     char **p;
 
     if (argc < 3) {
-        printf("Usage: %s port\-num proto-name [buflen]\\n", argv[0]);
+        printf("Usage: %s port\-num proto\-name [buflen]\\n", argv[0]);
         exit(EXIT_FAILURE);
     }
 
     port = htons(atoi(argv[1]));
     protop = (strcmp(argv[2], "null") == 0 ||
-             strcmp(argv[2], "NULL") == 0) ?  NULL : argv[2];
+              strcmp(argv[2], "NULL") == 0) ?  NULL : argv[2];
 
     buflen = 1024;
     if (argc > 3)
@@ -234,6 +238,15 @@ main(int argc, char *argv[])
     exit(EXIT_SUCCESS);
 }
 .fi
-.SH "SEE ALSO"
+.SH SEE ALSO
 .BR getservent (3),
 .BR services (5)
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.