Mon Sep 30 08:14:00 2013 UTC ()
Sort. Use .Ex for EXIT STATUS section.


(wiz)
diff -r1.1 -r1.2 src/usr.bin/getaddrinfo/getaddrinfo.1

cvs diff -r1.1 -r1.2 src/usr.bin/getaddrinfo/getaddrinfo.1 (expand / switch to unified diff)

--- src/usr.bin/getaddrinfo/getaddrinfo.1 2013/09/30 06:19:22 1.1
+++ src/usr.bin/getaddrinfo/getaddrinfo.1 2013/09/30 08:13:59 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: getaddrinfo.1,v 1.1 2013/09/30 06:19:22 riastradh Exp $ 1.\" $NetBSD: getaddrinfo.1,v 1.2 2013/09/30 08:13:59 wiz Exp $
2.\" 2.\"
3.\" Copyright (c) 2013 The NetBSD Foundation, Inc. 3.\" Copyright (c) 2013 The NetBSD Foundation, Inc.
4.\" All rights reserved. 4.\" All rights reserved.
5.\" 5.\"
6.\" This documentation is derived from text contributed to The NetBSD 6.\" This documentation is derived from text contributed to The NetBSD
7.\" Foundation by Taylor R. Campbell. 7.\" Foundation by Taylor R. Campbell.
8.\" 8.\"
9.\" Redistribution and use in source and binary forms, with or without 9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions 10.\" modification, are permitted provided that the following conditions
11.\" are met: 11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright 12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer. 13.\" notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" 2. Redistributions in binary form must reproduce the above copyright
@@ -17,39 +17,39 @@ @@ -17,39 +17,39 @@
17.\" 17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 21.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE. 28.\" POSSIBILITY OF SUCH DAMAGE.
29.\" 29.\"
30.Dd April 25, 2013 30.Dd September 30, 2013
31.Dt GETADDRINFO 1 31.Dt GETADDRINFO 1
32.Os 32.Os
33.Sh NAME 33.Sh NAME
34.Nm getaddrinfo 34.Nm getaddrinfo
35.Nd resolve names to socket addresses 35.Nd resolve names to socket addresses
36.Sh SYNOPSIS 36.Sh SYNOPSIS
37.Nm 37.Nm
38.Op Fl cnNP 38.Op Fl cNnP
39.Op Fl f Ar family 39.Op Fl f Ar family
40.Op Fl p Ar protocol 40.Op Fl p Ar protocol
41.Op Fl t Ar socktype 
42.Op Fl s Ar service 41.Op Fl s Ar service
 42.Op Fl t Ar socktype
43.Op Ar hostname 43.Op Ar hostname
44.Sh DESCRIPTION 44.Sh DESCRIPTION
45The 45The
46.Nm 46.Nm
47utility resolves host and service names to socket addresses as if with 47utility resolves host and service names to socket addresses as if with
48the 48the
49.Xr getaddrinfo 3 49.Xr getaddrinfo 3
50routine and formats them to standard output. 50routine and formats them to standard output.
51.Pp 51.Pp
52The output is a sequence of lines of space-separated fields: 52The output is a sequence of lines of space-separated fields:
53.Dl socket-type address-family protocol [af-specific data ...] 53.Dl socket-type address-family protocol [af-specific data ...]
54.Pp 54.Pp
55For the internet family, the address-family-specific data are the 55For the internet family, the address-family-specific data are the
@@ -76,75 +76,73 @@ and print it on the first line before th @@ -76,75 +76,73 @@ and print it on the first line before th
76.It Fl f Ar family 76.It Fl f Ar family
77Specify an address family. 77Specify an address family.
78Address families are named like the 78Address families are named like the
79.Dv AF_... 79.Dv AF_...
80constants for address family numbers in the 80constants for address family numbers in the
81.Aq Pa sys/socket.h 81.Aq Pa sys/socket.h
82header file but without the 82header file but without the
83.Dv AF_ 83.Dv AF_
84prefix and lowercase. 84prefix and lowercase.
85For example, 85For example,
86.Dq inet 86.Dq inet
87corresponds with 87corresponds with
88.Dv AF_INET . 88.Dv AF_INET .
89.It Fl n 
90Treat the hostname as a numeric address and do not attempt name 
91resolution, as if with the 
92.Dv AI_NUMERICHOST 
93flag to 
94.Xr getaddrinfo 3 . 
95.It Fl N 89.It Fl N
96Treat the service as numeric and do not attempt service name 90Treat the service as numeric and do not attempt service name
97resolution, as if with the 91resolution, as if with the
98.Dv AI_NUMERICSERV 92.Dv AI_NUMERICSERV
99flag to 93flag to
100.Xr getaddrinfo 3 . 94.Xr getaddrinfo 3 .
101.It Fl s Ar service 95.It Fl n
102Specify a service to look up. 96Treat the hostname as a numeric address and do not attempt name
103If no service is specified, a hostname must be specified. 97resolution, as if with the
104.It Fl p Ar protocol 98.Dv AI_NUMERICHOST
105Specify a protocol. 99flag to
106Protocols may be numeric, or symbolic as listed in 100.Xr getaddrinfo 3 .
107.Xr protocols 5 . 
108.It Fl P 101.It Fl P
109Return socket addresses intended for use with 102Return socket addresses intended for use with
110.Xr bind 2 , 103.Xr bind 2 ,
111as if with the 104as if with the
112.Dv AI_PASSIVE 105.Dv AI_PASSIVE
113flag to 106flag to
114.Xr getaddrinfo 3 . 107.Xr getaddrinfo 3 .
115By default, the socket addresses are intended for use with 108By default, the socket addresses are intended for use with
116.Xr connect 2 , 109.Xr connect 2 ,
117.Xr sendto 2 , 110.Xr sendto 2 ,
118or 111or
119.Xr sendmsg 2 . 112.Xr sendmsg 2 .
 113.It Fl p Ar protocol
 114Specify a protocol.
 115Protocols may be numeric, or symbolic as listed in
 116.Xr protocols 5 .
 117.It Fl s Ar service
 118Specify a service to look up.
 119If no service is specified, a hostname must be specified.
120.It Fl t Ar socktype 120.It Fl t Ar socktype
121Specify a socket type. 121Specify a socket type.
122Socket types are named like the 122Socket types are named like the
123.Dv SOCK_... 123.Dv SOCK_...
124constants for socket type numbers in the 124constants for socket type numbers in the
125.Aq Pa sys/socket.h 125.Aq Pa sys/socket.h
126header file but without the 126header file but without the
127.Dv SOCK_ 127.Dv SOCK_
128prefix and lowercase. 128prefix and lowercase.
129For example, 129For example,
130.Dq dgram 130.Dq dgram
131corresponds with 131corresponds with
132.Dv SOCK_DGRAM . 132.Dv SOCK_DGRAM .
133.El 133.El
134.Pp 134.Sh EXIT STATUS
135The 135.Ex -std getaddrinfo
136.Nm 
137utility exits 0 on success, and \*[Gt]0 if an error occurs. 
138.Sh EXAMPLES 136.Sh EXAMPLES
139Look up 137Look up
140.Dq www.NetBSD.org : 138.Dq www.NetBSD.org :
141.Bd -literal -offset indent 139.Bd -literal -offset indent
142$ getaddrinfo www.NetBSD.org 140$ getaddrinfo www.NetBSD.org
143dgram inet6 udp 2001:4f8:3:7:2e0:81ff:fe52:9ab6 0 141dgram inet6 udp 2001:4f8:3:7:2e0:81ff:fe52:9ab6 0
144dgram inet udp 149.20.53.67 0 142dgram inet udp 149.20.53.67 0
145stream inet6 tcp 2001:4f8:3:7:2e0:81ff:fe52:9ab6 0 143stream inet6 tcp 2001:4f8:3:7:2e0:81ff:fe52:9ab6 0
146stream inet tcp 149.20.53.67 0 144stream inet tcp 149.20.53.67 0
147.Ed 145.Ed
148The unspecified service manifested as a port number of zero. 146The unspecified service manifested as a port number of zero.
149.Pp 147.Pp
150Look up 148Look up