OSDN Git Service

(split) LDP: Update original to LDP v3.65
[linuxjm/LDP_man-pages.git] / original / man3 / inet.3
index c4b3200..a316a80 100644 (file)
@@ -1,9 +1,8 @@
-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\"
 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
 .\" and Copyright (c) 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.
@@ -23,6 +22,7 @@
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
 .\" References consulted:
 .\"     Linux libc source code
@@ -39,7 +39,7 @@
 .\"     Add discussion of Classful Addressing, noting that it is obsolete.
 .\"     Added an EXAMPLE program.
 .\"
-.TH INET 3  2008-06-19 "GNU" "Linux Programmer's Manual"
+.TH INET 3  2014-04-19 "GNU" "Linux Programmer's Manual"
 .SH NAME
 inet_aton, inet_addr, inet_network, inet_ntoa, inet_makeaddr, inet_lnaof,
 inet_netof \- Internet address manipulation routines
@@ -108,7 +108,7 @@ Part
 .I b
 is interpreted as a 24-bit value that defines the rightmost three bytes
 of the binary address.
-This notation is suitable for specifying (outmoded) Class C
+This notation is suitable for specifying (outmoded) Class A
 network addresses.
 .TP
 .I a
@@ -129,6 +129,15 @@ The form that uses exactly four decimal numbers is referred to as
 .IR "IPv4 dotted-decimal notation"
 (or sometimes:
 .IR "IPv4 dotted-quad notation" ).
+
+If
+.BR inet_aton ()
+returns 1 if the supplied string was successfully interpreted,
+or 0 if the string is invalid
+.RB ( errno
+is
+.I not
+set on error).
 .PP
 The
 .BR inet_addr ()
@@ -207,7 +216,7 @@ struct in_addr {
 };
 .fi
 .in
-.SH "CONFORMING TO"
+.SH CONFORMING TO
 4.3BSD.
 .BR inet_addr ()
 and
@@ -286,7 +295,7 @@ main(int argc, char *argv[])
     }
 
     if (inet_aton(argv[1], &addr) == 0) {
-        perror("inet_aton");
+        fprintf(stderr, "Invalid address\\n");
         exit(EXIT_FAILURE);
     }
 
@@ -294,13 +303,22 @@ main(int argc, char *argv[])
     exit(EXIT_SUCCESS);
 }
 .fi
-.SH "SEE ALSO"
+.SH SEE ALSO
 .BR byteorder (3),
 .BR getaddrinfo (3),
 .BR gethostbyname (3),
 .BR getnameinfo (3),
 .BR getnetent (3),
+.BR inet_net_pton (3),
 .BR inet_ntop (3),
 .BR inet_pton (3),
 .BR hosts (5),
 .BR networks (5)
+.SH COLOPHON
+This page is part of release 3.65 of the Linux
+.I man-pages
+project.
+A description of the project,
+and information about reporting bugs,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.