Module Name: src
Committed By: ginsbach
Date: Fri Jul 20 19:44:39 UTC 2012
Modified Files:
src/lib/libc/inet: inet_net.3
Log Message:
- Add an ERRORS section rather than incompletely documenting the
possible errno values in the DESCRIPTION section.
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/inet/inet_net.3
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libc/inet/inet_net.3
diff -u src/lib/libc/inet/inet_net.3:1.3 src/lib/libc/inet/inet_net.3:1.4
--- src/lib/libc/inet/inet_net.3:1.3 Fri Jul 20 13:40:58 2012
+++ src/lib/libc/inet/inet_net.3 Fri Jul 20 19:44:39 2012
@@ -1,4 +1,4 @@
-.\" $NetBSD: inet_net.3,v 1.3 2012/07/20 13:40:58 ginsbach Exp $
+.\" $NetBSD: inet_net.3,v 1.4 2012/07/20 19:44:39 ginsbach Exp $
.\"
.\" Copyright (c) 1997 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -27,7 +27,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd December 8, 2001
+.Dd July 20, 2012
.Dt INET_NET 3
.Os
.Sh NAME
@@ -58,7 +58,7 @@ argument is the number of bits in
that are the network number.
It returns
.Dv NULL
-if a system error occurs (in which case,
+if an error occurs (in which case
.Va errno
will have been set), or it returns a pointer to the destination string.
.Pp
@@ -72,10 +72,7 @@ It returns the number of bits (either co
specified with /CIDR), or \-1 if a failure occurred
(in which case
.Va errno
-will have been set.
-It will be set to
-.Er ENOENT
-if the Internet network number was not valid).
+will have been set).
.Pp
The currently supported values for
.Fa af
@@ -141,6 +138,49 @@ otherwise, the number is interpreted as
.\" .Sh NETWORK NUMBERS (IP VERSION 6)
.\" XXX - document this!
.\"
+.Sh ERRORS
+The
+.Fn inet_net_ntop
+and
+.Fn inet_net_pton
+functions may fail with
+.Bl -tag -width Er
+.It Bq Er EAFNOSUPPORT
+The value of
+.Fa af
+was not
+.Dv AF_INET
+or
+.Dv AF_INET6 .
+.It Bq Er EMSGSIZE
+The conversion of
+.Fa src
+overflows
+.Fa size
+of
+.Fa dst.
+.El
+.Pp
+The
+.Fn inet_net_ntop
+function may fail with
+.Bl -tag -width Er
+.It Bq Er EINVAL
+The
+.Fa bits
+argument contains an invalid number of bits
+for the requested address family.
+.El
+.Pp
+The
+.Fn inet_net_pton
+function may fail with
+.Bl -tag -width Er
+.It Bq Er ENOENT
+The
+.Fa src
+was not a valid Internet network number.
+.El
.Sh SEE ALSO
.Xr byteorder 3 ,
.Xr inet 3 ,