From owner-man-jp-reviewer@jp.freebsd.org  Wed Aug 22 11:34:12 2001
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id LAA23035;
	Wed, 22 Aug 2001 11:34:12 +0900 (JST)
	(envelope-from owner-man-jp-reviewer@jp.FreeBSD.org)
Received: from ns.agt.ne.jp (ns.agt.ne.jp [203.141.139.101])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id LAA22940
	for <man-jp-reviewer@jp.freebsd.org>; Wed, 22 Aug 2001 11:34:08 +0900 (JST)
	(envelope-from a-gota@agt.ne.jp)
Received: (from daemon@localhost)
	by ns.agt.ne.jp (8.11.3/8.11.3) id f7M2Jlv96342
	for <man-jp-reviewer@jp.freebsd.org>; Wed, 22 Aug 2001 11:19:47 +0900 (JST)
	(envelope-from a-gota@agt.ne.jp)
To: man-jp-reviewer@jp.freebsd.org
In-Reply-To: <20010821.021621.30131788.horikawa@psinet.com>
References: <20010810.112426.74722140.mori@tri.asanuma.co.jp>
	<80y9ofb6b9.fsf@kurishna.tri.asanuma.co.jp>
	<20010821.021621.30131788.horikawa@psinet.com>
X-Mailer: Mew version 1.94.1 on Emacs 19.34 / Mule 2.3 (SUETSUMUHANA)
Mime-Version: 1.0
Content-Type: Multipart/Mixed;
 boundary="--Next_Part(Wed_Aug_22_11:18:58_2001_756)--"
Content-Transfer-Encoding: 7bit
Message-Id: <20010822111929B.a-gota@agt.ne.jp>
Date: Wed, 22 Aug 2001 11:19:29 +0900
From: Akihiko GOTANDA <a-gota@agt.ne.jp>
X-Dispatcher: imput version 20000228(IM140)
Lines: 838
Reply-To: man-jp-reviewer@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+010328
X-Sequence: man-jp-reviewer 3750
Subject: [man-jp-reviewer 3750] freeaddrinfo.3
Errors-To: owner-man-jp-reviewer@jp.freebsd.org
Sender: owner-man-jp-reviewer@jp.freebsd.org
X-Originator: a-gota@agt.ne.jp

----Next_Part(Wed_Aug_22_11:18:58_2001_756)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit

$B8^H?ED!wKOElK?=j$G$9!#(B

$B$U$H;W$$N)$C$F!"(Bfreeaddrinfo.3 $B$rLu$7$F$_$^$7$?!#=iLu$G$9!#1Q8lHG$O(B 
http://veltec.co.jp/jman/newlist.php $B$+$i<hF@$7$^$7$?!#(Boriginal $B$+$i$N(B
$B:9J,$G$9!#(B

$B!t(B $BBgJ,0ULu$7$F$$$^$9$,!#(B

$B$H$3$m$G!"$3$l$b$d$O$j(B

  .St -p1003.1g-2000

$B$,I=<($5$l$^$;$s$M!#1Q8lHG$G$OF1$8FbMF$G$A$c$s$HI=<($5$l$k$s$G$9$1$I!#(B


                                   $B8^H?ED(B $B=)I'(B
                                   a-gota@agt.ne.jp
                                   http://www.agt.ne.jp/~a-gota/
                            $B!A(B Powered by FreeBSD and Masashi Sada $B!A(B

----Next_Part(Wed_Aug_22_11:18:58_2001_756)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Content-Description: freeaddrinfo.3.en-ja.diff
Content-Disposition: attachment; filename="freeaddrinfo.3.en-ja.diff"

--- freeaddrinfo.3.en	Sat Apr 28 06:11:54 2001
+++ freeaddrinfo.3	Wed Aug 22 11:06:52 2001
@@ -38,15 +38,15 @@
 .Dt GETADDRINFO 3
 .Os
 .\"
-.Sh NAME
+.Sh $BL>>N(B
 .Nm getaddrinfo ,
 .Nm freeaddrinfo ,
 .Nm gai_strerror
-.Nd nodename-to-address translation in protocol-independent manner
+.Nd $B%W%m%H%3%kHs0MB8$JJ}K!$K$h$k%N!<%IL>(B-$B%"%I%l%9JQ49(B
 .\"
-.Sh LIBRARY
+.Sh $B%i%$%V%i%j(B
 .Lb libc
-.Sh SYNOPSIS
+.Sh $B=q<0(B
 .Fd #include <sys/types.h>
 .Fd #include <sys/socket.h>
 .Fd #include <netdb.h>
@@ -58,21 +58,22 @@
 .Ft "char *"
 .Fn gai_strerror "int ecode"
 .\"
-.Sh DESCRIPTION
+.Sh $B2r@b(B
 The
 .Fn getaddrinfo
-function is defined for protocol-independent nodename-to-address translation.
-It performs the functionality of
+$B4X?t$O%W%m%H%3%kHs0MB8$J%N!<%IL>(B-$B%"%I%l%9JQ49$r<B8=$9$k$?$a$K(B
+$BDj5A$5$l$^$7$?!#(B
+$B$3$l$O(B
 .Xr gethostbyname 3
-and
-.Xr getservbyname 3 ,
-but in a more sophisticated manner.
+$B$H(B
+.Xr getservbyname 3
+$B$N5!G=$r!"$h$j@vN}$5$l$?J}K!$GDs6!$9$k$b$N$G$9!#(B
 .Pp
-The
+$B7k2L$r3JG<$9$k(B
 .Li addrinfo
-structure is defined as a result of including the
+$B9=B$BN$O!"(B
 .Aq Pa netdb.h
-header:
+$B%X%C%@$r<h$j9~$`$3$H$G0J2<$N$h$&$KDj5A$5$l$^$9(B:
 .Bd -literal -offset
 struct addrinfo {                                                  *
      int     ai_flags;     /* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */
@@ -86,333 +87,342 @@
 };
 .Ed
 .Pp
-The
 .Fa nodename
-and
+$B$H(B
 .Fa servname
-arguments are pointers to null-terminated strings or
-.Dv NULL .
-One or both of these two arguments must be a
-.Pf non Dv -NULL
-pointer.
-In the normal client scenario, both the
+$B0z?t$K$O!"%L%kJ8;z$G=*N;$9$kJ8;zNs$X$N%]%$%s%?$+!"(B
+.Dv NULL
+$B$rM?$($^$9!#(B
+$B$3$l$i$N0z?t$N>/$J$/$H$bJRJ}$O(B
+.Dv NULL
+$B$G$J$$%]%$%s%?$G$J$/$F$O$J$j$^$;$s!#(B
+$B%/%i%$%"%s%HB&$G$O!"DL>o(B
 .Fa nodename
-and
+$B$H(B
 .Fa servname
-are specified.
-In the normal server scenario, only the
+$B$NN>J}$H$bCM$r@_Dj$7$^$9!#(B
+$B$^$?!"%5!<%PB&$G$O!"DL>o(B
 .Fa servname
-is specified.
-A
-.Pf non Dv -NULL
+$B$N$_$rM?$($^$9!#(B
+.Dv NULL
+$B$G$J$$(B
 .Fa nodename
-string can be either a node name or a numeric host address string
-.Po
-i.e., a dotted-decimal IPv4 address or an IPv6 hex address
-.Pc .
-A
-.Pf non Dv -NULL
+$BJ8;zNs$K$O!"%N!<%IL>!"$b$7$/$O%[%9%H%"%I%l%9$N?tCMJ8;zNs(B
+.Pq $B%I%C%H6h@Z$j(B 10 $B?JI=5-$N(B IPv4 $B%"%I%l%9$+!"(B16 $B?JI=5-$N(B IPv6 $B%"%I%l%9(B
+$B$,;XDj$G$-$^$9!#(B
+.Dv NULL
+$B$G$J$$(B
 .Fa servname
-string can be either a service name or a decimal port number.
+$BJ8;zNs$K$O!"%5!<%S%9L>$+(B 10 $B?JI=5-$N%]!<%HHV9f$rM?$($k$3$H$,$G$-$^$9!#(B
 .Pp
-The caller can optionally pass an
+$B8F$S=P$7$N:]!"(B3 $BHVL\$N0z?t$K$O!"8F$S=P$785$,%5%]!<%H$9$k%=%1%C%H$N(B
+$B<oN`$r<($9%R%s%H$H$7$F!"DI2CE*$J(B
 .Li addrinfo
-structure, pointed to by the third argument,
-to provide hints concerning the type of socket that the caller supports.
-In this
+$B9=B$BN$rEO$9$3$H$,$G$-$^$9!#(B
+$B$3$N(B
 .Fa hints
-structure all members other than
+$B9=B$BN$O!"(B
 .Fa ai_flags ,
 .Fa ai_family ,
-.Fa ai_socktype ,
-and
+.Fa ai_socktype
+$B5Z$S(B
 .Fa ai_protocol
-must be zero or a
+$B0J30$NA4$F$N%a%s%P$K!"(B0 $B$^$?$O(B
 .Dv NULL
-pointer.
-A value of
-.Dv PF_UNSPEC
-for
+$B%]%$%s%?$,3JG<$5$l$F$$$J$1$l$P$J$j$^$;$s!#(B
 .Fa ai_family
-means the caller will accept any protocol family.
-A value of 0 for
+$B$K(B
+.Dv PF_UNSPEC
+$B$,3JG<$5$l$F$$$?>l9g!"8F$S=P$785$OA4$F$N%W%m%H%3%k%U%!%_%j$r<u$1F~$l$k(B
+$B$3$H$r<($7$^$9!#(B
 .Fa ai_socktype
-means the caller will accept any socket type.
-A value of 0 for
+$B$K(B 0 $B$,3JG<$5$l$F$$$?>l9g!"A4$F$N%=%1%C%H%?%$%W$r07$($k$3$H$r<($7$^$9!#(B
+$BF1MM$K!"(B
 .Fa ai_protocol
-means the caller will accept any protocol.
-For example, if the caller handles only TCP and not UDP, then the
+$B$K(B 0 $B$,3JG<$5$l$F$$$k$H!"A4$F$N%W%m%H%3%k$r07$($k$3$H$r<($7$^$9!#(B
+$BNc$($P!"8F$S=P$785$,(B TCP $B$N$_$r07$C$F(B UDP $B$r07$o$J$$>l9g!"(B
+.Fn getaddrinfo
+$B$r8F$S=P$9:]!"(B
+.Fa hints
+$B9=B$BN$N(B
 .Fa ai_socktype
-member of the hints structure should be set to
+$B%a%s%P$K$O(B
 .Dv SOCK_STREAM
-when
+$B$r3JG<$9$k$3$H$K$J$j$^$9!#(B
+$B$b$78F$S=P$785$,(B IPv4 $B$N$_07$C$F(B IPv6 $B$r07$o$J$$>l9g!"(B
 .Fn getaddrinfo
-is called.
-If the caller handles only IPv4 and not IPv6, then the
-.Fa ai_family
-member of the
+$B$N8F$S=P$7$N:]$K(B
 .Fa hints
-structure should be set to
+$B9=B$BN$N(B
+.Fa ai_family
+$B%a%s%P$K$O(B
 .Dv PF_INET
-when
-.Fn getaddrinfo
-is called.
-If the third argument to
+$B$r3JG<$9$k$3$H$K$J$j$^$9!#(B
 .Fn getaddrinfo
-is a
+$B$N(B 3 $BHVL\$N0z?t$,(B
 .Dv NULL
-pointer, this is the same as if the caller had filled in an
+$B%]%$%s%?$G$"$k>l9g!"$3$N(B
 .Li addrinfo
-structure initialized to zero with
+$B9=B$BN$N$&$A(B
 .Fa ai_family
-set to
-.Dv PF_UNSPEC .
+$B$r(B
+.Dv PF_UNSPEC
+$B$K@_Dj$7$F;D$j$N%a%s%P$r(B 0 $B$G=i4|2=$7$?$b$N$rEO$9$N$HF1$8$3$H$K(B
+$B$J$j$^$9!#(B
 .Pp
-Upon successful return a pointer to a linked list of one or more
-.Li addrinfo
-structures is returned through the final argument.
-The caller can process each
+$B8F$S=P$7$,@.8y$7$?>l9g!"0l$D$^$?$O$=$l0J>e$N(B
 .Li addrinfo
-structure in this list by following the
+$B9=B$BN$,%j%s%/$5$l$?%j%9%H$X$N%]%$%s%?$,4X?t$N:G8e$N0z?t$rDL$8$F(B
+$BJV$5$l$^$9!#(B
+$B8F$S=P$785$O!"(B
 .Fa ai_next
-pointer, until a
+$B%]%$%s%?$r(B
 .Dv NULL
-pointer is encountered.
-In each returned
+$B$K9T$-Ev$?$k$^$GC)$k$3$H$K$h$j!"$3$N%j%9%H$N8D!9$N(B
 .Li addrinfo
-structure the three members
+$B9=B$BN$r=hM}$9$k$3$H$,$G$-$^$9!#(B
+$B$=$l$>$l$N(B
+.Li addrinfo
+$B9=B$BN$K$O!"(B
+.Fn socket
+$B$r8F$S=P$9:]$K;HMQ$9$k(B
 .Fa ai_family ,
-.Fa ai_socktype ,
-and
+.Fa ai_socktype
+$B5Z$S(B
 .Fa ai_protocol
-are the corresponding arguments for a call to the
-.Fn socket
-function.
-In each
+$B$N(B 3 $B$D$N%a%s%P$,JV$5$l$^$9!#(B
+$B8D!9$N(B
 .Li addrinfo
-structure the
+$B9=B$BN$N(B
 .Fa ai_addr
-member points to a filled-in socket address structure whose length is
-specified by the
+$B%a%s%P$K$O!"I,MW$JCM$,A4$FB7$C$?%=%1%C%H%"%I%l%99=B$BN$X$N%]%$%s%?$,(B
+$B3JG<$5$l!"$5$i$K$=$N9=B$BN$NBg$-$5$,(B
 .Fa ai_addrlen
-member.
+$B%a%s%P$K3JG<$5$l$^$9!#(B
 .Pp
-If the
-.Dv AI_PASSIVE
-bit is set in the
-.Fa ai_flags
-member of the
+$B$b$7(B
 .Fa hints
-structure, then the caller plans to use the returned socket address
-structure in a call to
-.Fn bind .
-In this case, if the
+$B9=B$BN$N(B
+.Fa ai_flags
+$B%a%s%P$NCf$N(B
+.Dv AI_PASSIVE
+$B%S%C%H$,%;%C%H$5$l$F$$$k>l9g!"(B
+$B8F$S=P$785$,(B
+.Fn bind
+$B$N8F$S=P$7$K;HMQ$9$k%=%1%C%H%"%I%l%99=B$BN$r<hF@$7$h$&$H$7$F$$$k$3$H$r(B
+$B<($7$^$9!#(B
+$B$3$N:]!"(B
 .Fa nodename
-argument is a
+$B0z?t$K(B
 .Dv NULL
-pointer, then the IP address portion of the socket
-address structure will be set to
+$B%]%$%s%?$,M?$($i$l$F$$$k$H!"%=%1%C%H%"%I%l%99=B$BN$N(B IP $B%"%I%l%9It$K!"(B
+IPv4 $B%"%I%l%9$N>l9g$O(B
 .Dv INADDR_ANY
-for an IPv4 address or
+$B$,!"(BIPv6 $B%"%I%l%9$N>l9g$O(B
 .Dv IN6ADDR_ANY_INIT
-for an IPv6 address.
+$B$,!"$=$l$>$l@_Dj$5$l$^$9!#(B
 .Pp
-If the
-.Dv AI_PASSIVE
-bit is not set in the
-.Fa ai_flags
-member of the
 .Fa hints
-structure, then the returned socket address structure will be ready for a
-call to
+$B9=B$BN$N(B
+.Fa ai_flags
+$B%a%s%P$NCf$N(B
+.Dv AI_PASSIVE
+$B%S%C%H$,%;%C%H$5$l$F$$$J$$$H$-!"(B
 .Fn connect
-.Pq for a connection-oriented protocol
-or either
+.Pq $B%3%M%/%7%g%s;X8~%W%m%H%3%k$N>l9g(B
+$B$+!"$b$7$/$O(B
 .Fn connect ,
-.Fn sendto ,
-or
+.Fn sendto
+$B5Z$S(B
 .Fn sendmsg
-.Pq for a connectionless protocol .
-In this case, if the
+.Pq $B%3%M%/%7%g%s%l%9%W%m%H%3%k$N>l9g(B
+$B$N8F$S=P$7$K;HMQ2DG=$J%=%1%C%H%"%I%l%99=B$BN$,JV$5$l$^$9!#(B
+$B$3$N:]!"(B
 .Fa nodename
-argument is a
+$B0z?t$K(B
 .Dv NULL
-pointer, then the IP address portion of the
-socket address structure will be set to the loopback address.
+$B%]%$%s%?$,M?$($i$l$k$H!"%=%1%C%H%"%I%l%99=B$BN$N(B IP $B%"%I%l%9It$K$O(B
+$B%k!<%W%P%C%/%"%I%l%9$,3JG<$5$l$^$9!#(B
 .Pp
-If the
-.Dv AI_CANONNAME
-bit is set in the
-.Fa ai_flags
-member of the
 .Fa hints
-structure, then upon successful return the
-.Fa ai_canonname
-member of the first
+$B9=B$BN$N(B
+.Fa ai_flags
+$B%a%s%P$NCf$N(B
+.Dv AI_CANONNAME
+$B%S%C%H$r%;%C%H$7$?8F$S=P$7$,@.8y$7$?>l9g!"JV$5$l$k%j%9%H$N@hF,$N(B
 .Li addrinfo
-structure in the linked list will point to a null-terminated string
-containing the canonical name of the specified
-.Fa nodename .
+$B9=B$BN$N(B
+.Fa ai_canonname
+$B%a%s%P$K$O!"4X?t$N8F$S=P$7$N:]$K;XDj$7$?(B
+.Fa nodename
+$B$KBP$9$k@5<0$J%[%9%HL>$r<($9!"%L%k$G=*N;$9$kJ8;zNs$X$N%]%$%s%?$,(B
+$B3JG<$5$l$F$$$^$9!#(B
 .Pp
-If the
-.Dv AI_NUMERICHOST
-bit is set in the
-.Fa ai_flags
-member of the
 .Fa hints
-structure, then a
-.Pf non Dv -NULL
+$B9=B$BN$N(B
+.Fa ai_flags
+$B%a%s%P$NCf$N(B
+.Dv AI_NUMERICHOST
+$B%S%C%H$,%;%C%H$7$?>l9g!"(B
+.Dv NULL
+$B$G$J$$(B
 .Fa nodename
-string must be a numeric host address string.
-Otherwise an error of
+$BJ8;zNs$O%[%9%H%"%I%l%9$N?t;zJ8;zNs$G$J$1$l$P$J$j$^$;$s!#$=$&$G$J$$>l9g!"(B
 .Dv EAI_NONAME
-is returned.
-This flag prevents any type of name resolution service (e.g., the DNS)
-from being called.
+$B$H$$$&%(%i!<$,JV$5$l$^$9!#(B
+$B$3$N%U%i%0$r;XDj$9$k$H!"4X?t$N8F$S=P$7$N:]!"(B(DNS $B$N$h$&$J(B) $B$"$i$f$k(B
+$B<oN`$NL>A02r7h%5!<%S%9$NMxMQ$rM^;_$7$^$9!#(B
 .Pp
-The arguments to
 .Fn getaddrinfo
-must sufficiently be consistent and unambiguous.
-Here are pitfall cases you may encounter:
+$B$N0z?t$K$O!"==J,$J0l4S@-$,MW5a$5$l!"$+$D[#Kf$5$,$"$C$F$O$J$j$^$;$s!#(B
+$B$h$/4Y$j$,$A$JMn$H$77j$O<!$NDL$j$G$9(B:
 .Bl -bullet
 .It
-.Fn getaddrinfo
-will raise error if members in 
 .Fa hints
-structure is not consistent.
-For example, for internet address families,
+$B9=B$BN$N%a%s%P$K0l4S@-$,$J$$>l9g!"(B
 .Fn getaddrinfo
-will raise error if you specify
-.Dv SOCK_STREAM
-to
-.Fa ai_socktype
-while you specify
+$B$O%(%i!<$K$J$j$^$9!#(B
+$BNc$($P!"%$%s%?!<%M%C%H%"%I%l%9%U%!%_%j$K4X$7$F!"(B
+.Fa ai_protocol
+$B$K$O(B
 .Dv IPPROTO_UDP
-to
-.Fa ai_protocol .
+$B$r;XDj$7$?$N$K(B
+.Fa ai_socktype
+$B$K(B
+.Dv SOCK_STREAM
+$B$r;XDj$7$F$$$k$H!"(B
+.Fn getaddrinfo
+$B$O%(%i!<$rJV$7$^$9!#(B
 .It
-If you specify a
+$BFCDj$N(B
+.Fa ai_socktype
+$B$K$N$_Dj5A$5$l$F$$$k(B
 .Fa servname
-which is defined only for certain
-.Fa ai_socktype ,
+$B$r;XDj$9$k$H!"0z?t$N0l4S@-$,J]$F$J$$$?$a!"(B
 .Fn getaddrinfo
-will raise error because the arguments are not consistent.
-For example,
-.Fn getaddrinfo
-will raise error if you ask for
+$B$,%(%i!<$K$J$k$3$H$,$"$j$^$9!#(B
+$BNc$($P!"(B
+.Dv SOCK_STREAM
+$B$KBP$7$F(B
 .Dq Li tftp
-service on
-.Dv SOCK_STREAM .
+$B%5!<%S%9$rLd$$9g$o$;$k$H!"(B
+.Fn getaddrinfo
+$B$O%(%i!<$rJV$7$^$9!#(B
 .It
-For internet address families, if you specify
-.Fa servname
-while you set
+$B%$%s%?!<%M%C%H%"%I%l%9%U%!%_%j$K4X$7$F!"(B
 .Fa ai_socktype
-to
-.Dv SOCK_RAW ,
-.Fn getaddrinfo
-will raise error, because service names are not defined for the internet
+$B$r(B
+.Dv SOCK_RAW
+$B$H$7$?>uBV$G(B
+.Fa servname
+$B$r;XDj$9$k$H!"(B
+$B%$%s%?!<%M%C%H$N(B
 .Dv SOCK_RAW
-space.
+$B6u4V$G$O$$$+$J$k%5!<%S%9L>$bDj5A$5$l$F$$$J$$$?$a!"(B
+.Fn getaddrinfo
+$B$O%(%i!<$rJV$7$^$9!#(B
 .It
-If you specify numeric
-.Fa servname ,
-while leaving
 .Fa ai_socktype
-and
+$B$H(B
 .Fa ai_protocol
-unspecified,
+$B$r;XDj$7$J$$$^$^(B
+.Fa servname
+$B$K(B ($B%]!<%HL>$G$J$/(B) $B%]!<%HHV9f$r;XDj$9$k$H!"(B
 .Fn getaddrinfo
-will raise error.
-This is because the numeric
+$B$O%(%i!<$rJV$7$^$9!#(B
+$B$3$l$O!"(B
 .Fa servname
-does not identify any socket type, and
+$B$K?tCM$,;XDj$5$l$F$7$^$&$H%=%1%C%H%?%$%W$,H=JL$G$-$:!"$3$N$h$&$J>l9g(B
 .Fn getaddrinfo
-is not allowed to glob the argument in such case.
+$B$O0z?t$r<h$jE;$a$k$3$H$,$G$-$J$$$?$a$G$9!#(B
 .El
 .Pp
-All of the information returned by
 .Fn getaddrinfo
-is dynamically allocated:
-the
+$B$,JV$9!"(B
 .Li addrinfo
-structures, the socket address structures, and canonical node name
-strings pointed to by the addrinfo structures.
-To return this information to the system the function
+$B9=B$BN$d%=%1%C%H%"%I%l%99=B$BN!"(Baddrinfo $B9=B$BN$K%]%$%s%?$,3JG<$5$l$k(B
+$B@5<0%[%9%HL>$r<($9J8;zNs$H$$$C$?>pJs$N5-210h$O!"A4$FF0E*$K3NJ]$5$l$^$9!#(B
+$B$3$l$i$N>pJs$N5-210h$r%7%9%F%`$KJV$9$K$O!"(B
 .Fn freeaddrinfo
-is called.
-The
-.Fa addrinfo
-structure pointed to by the
+$B$r8F$S=P$7$^$9!#(B
+$B$3$N4X?t$r8F$S=P$9$H!"(B
 .Fa ai argument
-is freed, along with any dynamic storage pointed to by the structure.
-This operation is repeated until a
-.Dv NULL
+$B0z?t$,;X$7<($9(B
+.Fa addrinfo
+$B9=B$BN$d!"$=$N9=B$BN$N%a%s%P$,;X$7<($9F0E*5-210h$,!"A4$F2rJ|$5$l$^$9!#(B
+$B$3$NA`:n$O!"(B
 .Fa ai_next
-pointer is encountered.
+$B%]%$%s%?$rC)$C$F(B
+.Dv NULL
+$B$K9T$-Ev$?$k$^$G7+$jJV$79T$J$o$l$^$9!#(B
 .Pp
-To aid applications in printing error messages based on the
+.Fn getaddrinfo
+$B4X?t$,JV$9%(%i!<%3!<%I(B
 .Dv EAI_xxx
-codes returned by
-.Fn getaddrinfo ,
+$B$KBP1~$9$k%(%i!<%a%C%;!<%8$rI=<($9$k%"%W%j%1!<%7%g%s$KBP$7$FJX59$r(B
+$B?^$k$?$a!"(B
 .Fn gai_strerror
-is defined.
-The argument is one of the
+$B$,Dj5A$5$l$F$$$^$9!#(B
+$B;vA0$KDj5A$5$l$F$$$k(B
 .Dv EAI_xxx
-values defined earlier and the return value points to a string describing
-the error.
-If the argument is not one of the
+$B$NCM$r0z?t$KM?$($k$H!"$=$N%(%i!<$KBP1~$7$?%a%C%;!<%8J8;zNs$X$N(B
+$B%]%$%s%?$rJV$7$^$9!#(B
+$B$b$7(B
 .Dv EAI_xxx
-values, the function still returns a pointer to a string whose contents
-indicate an unknown error.
+$B$H$7$FDj5A$5$l$F$$$J$$CM$rM?$($k$H!"!VL$CN$N%(%i!<!W$G$"$k;]$r<($9(B
+$BJ8;zNs$X$N%]%$%s%?$rJV$7$^$9!#(B
 .\"
-.Sh EXTENSION
-The implementation allows experimental numeric IPv6 address notation with
-scope identifier.
-By appending atmark and scope identifier to addresses, you can fill
+.Sh $B3HD%(B
+$B8=:_$N<BAu$O!";n83E*$K(B IPv6 $B%"%I%l%9$N%9%3!<%W;X<(;RIU$-?tCM5-K!$r(B
+$B=hM}$G$-$k$h$&$K$J$C$F$$$^$9!#(B
+$B%"%I%l%9$K%Q!<%;%s%H5-9f$H%9%3!<%W;X<(;R$rIU2C$9$k$3$H$K$h$C$F!"$=$N(B
+$B%"%I%l%9$KBP$9$k(B
 .Li sin6_scope_id
-field for addresses.
-This would make management of scoped address easier,
-and allows cut-and-paste input of scoped address.
-.Pp
-At this moment the code supports only link-local addresses with the format.
-Scope identifier is hardcoded to name of hardware interface associated
-with the link.
+$B%U%#!<%k%I$rKd$a$k$3$H$,$G$-$^$9!#(B
+$B$3$N5!G=$K$h$C$F%9%3!<%WIU$-%"%I%l%9$N4IM}$,4JC1$K$J$k$H$H$b$K!"(B
+$B%9%3!<%WIU$-%"%I%l%9$NF~NO$N@Z$jE=$j$,$G$-$k$h$&$K$J$j$^$9!#(B
+.Pp
+$B8=;~E@$G$O!"$3$N7A<0$O%j%s%/%m!<%+%k%"%I%l%9$K$D$$$F$N$_(B
+$B%5%]!<%H$5$l$F$$$^$9!#(B
+$B%9%3!<%W;X<(;R$O!"%j%s%/$K4XO"$E$1$i$l$?%O!<%I%&%'%"%$%s%?%U%'!<%9$N(B
+$BL>A0(B
 .Po
-such as
 .Li ne0
-.Pc .
-Example would be like
-.Dq Li fe80::1%ne0 ,
-which means
+$B$N$h$&$J(B
+.Pc 
+$B$,$=$N$^$^;H$o$l$^$9!#(B
+$BNc$($P(B
+.Dq Li fe80::1%ne0
+$B$H=q$+$l$?$H$-!"$3$l$O(B
 .Do
-.Li fe80::1
-on the link associated with
 .Li ne0
-interface
-.Dc .
+$B%$%s%?%U%'!<%9$K4XO"$E$1$i$l$?%j%s%/>e$N(B
+.Li fe80::1
+.Dc
+$B$H$$$&0UL#$K$J$j$^$9!#(B
 .Pp
-The implementation is still very experimental and non-standard.
-The current implementation assumes one-by-one relationship between
-interface and link, which is not necessarily true from the specification.
+$B$3$N<BAu$O$4$/;n83E*$J$b$N$G!"I8=`2=$5$l$?$b$N$G$O$"$j$^$;$s!#(B
+$B8=:_$N<BAu$O%$%s%?%U%'!<%9$H%j%s%/$N4V$N4XO"$r0l$D0l$D7k$SIU$1$k$?$a$N(B
+$B$b$N$G$"$C$F!";EMM$N>e$GI,$:$7$b@5$7$$$b$N$G$O$"$j$^$;$s!#(B
 .\"
-.Sh EXAMPLES
-The following code tries to connect to
+.Sh $BNc(B
+$B0J2<$N%3!<%I$O!"(B
 .Dq Li www.kame.net
-service
-.Dq Li http .
-via stream socket.
-It loops through all the addresses available, regardless from address family.
-If the destination resolves to IPv4 address, it will use
+$B$N(B
+.Dq Li http
+$B%5!<%S%9$KBP$7$F%9%H%j!<%`%=%1%C%H$r;H$C$F@\B3$r;n$_$k$b$N$G$9!#(B
+$BM-8z$J%"%I%l%9A4$F$K$D$$$F!"%"%I%l%9%U%!%_%j$rLd$o$:!"0lDL$j@\B3$r(B
+$B9T$J$$$^$9!#(B
+$B@\B3@h$N%"%I%l%9$,(B IPv4 $B$@$C$?>l9g$O(B
 .Dv AF_INET
-socket.
-Similarly, if it resolves to IPv6,
+$B%=%1%C%H$r;HMQ$7$^$9!#(B
+$BF1MM$K!"%"%I%l%9$,(B IPv6 $B$@$C$?>l9g$O(B
 .Dv AF_INET6
-socket is used.
-Observe that there is no hardcoded reference to particular address family.
-The code works even if
+$B%=%1%C%H$r;HMQ$7$^$9!#(B
+$B;HMQ$9$k%"%I%l%9%U%!%_%j$K:81&$5$l$k5-=R$,$J$$$3$H$KCmL\$7$F$/$@$5$$!#(B
+$B$3$N%3!<%I$O(B
 .Fn getaddrinfo
-returns addresses that are not IPv4/v6.
+$B$,JV$9%"%I%l%9$,(B IPv4/v6 $B$G$J$$>l9g$G$9$i$bF0:n$7$^$9!#(B
 .Bd -literal -offset indent
 struct addrinfo hints, *res, *res0;
 int error;
@@ -425,7 +435,7 @@
 error = getaddrinfo("www.kame.net", "http", &hints, &res0);
 if (error) {
 	errx(1, "%s", gai_strerror(error));
-	/*NOTREACHED*/
+	/* $B$3$N@h$O<B9T$5$l$J$$(B */
 }
 s = -1;
 for (res = res0; res; res = res->ai_next) {
@@ -443,18 +453,18 @@
 		continue;
 	}
 
-	break;	/* okay we got one */
+	break;	/* $B@\B3$K@.8y$7$?(B */
 }
 if (s < 0) {
 	err(1, cause);
-	/*NOTREACHED*/
+	/* $B$3$N@h$O<B9T$5$l$J$$(B */
 }
 freeaddrinfo(res0);
 .Ed
 .Pp
-The following example tries to open wildcard listening socket onto service
-.Dq Li http ,
-for all the address families available.
+$B0J2<$NNc$O!"M-8z$JA4$F$N%"%I%l%9%U%!%_%j$KBP$9$k(B
+.Dq Li http
+$B%5!<%S%9$N%o%$%k%I%+!<%I%j%9%K%s%0%=%1%C%H$r3+$3$&$H$9$k$b$N$G$9!#(B
 .Bd -literal -offset indent
 struct addrinfo hints, *res, *res0;
 int error;
@@ -469,7 +479,7 @@
 error = getaddrinfo(NULL, "http", &hints, &res0);
 if (error) {
 	errx(1, "%s", gai_strerror(error));
-	/*NOTREACHED*/
+	/* $B$3$N@h$O<B9T$5$l$J$$(B */
 }
 nsock = 0;
 for (res = res0; res && nsock < MAXSOCK; res = res->ai_next) {
@@ -490,72 +500,76 @@
 }
 if (nsock == 0) {
 	err(1, cause);
-	/*NOTREACHED*/
+	/* $B$3$N@h$O<B9T$5$l$J$$(B */
 }
 freeaddrinfo(res0);
 .Ed
 .\"
-.Sh FILES
+.Sh $B%U%!%$%k(B
 .Bl -tag -width /etc/resolv.conf -compact
 .It Pa /etc/hosts
 .It Pa /etc/host.conf
 .It Pa /etc/resolv.conf
 .El
 .\"
-.Sh DIAGNOSTICS
-Error return status from
+.Sh $B?GCG(B
 .Fn getaddrinfo
-is zero on success and non-zero on errors.
-Non-zero error codes are defined in
-.Aq Pa netdb.h ,
-and as follows:
+$B$+$iJV$5$l$k%(%i!<>pJs$O!"@.8y$7$?$H$-$O(B 0$B!"<:GT$7$?$H$-$OHs(B 0 $B$K(B
+$B$J$j$^$9!#(B
+0 $B$G$J$$%(%i!<%3!<%I$O!"(B
+.Aq Pa netdb.h
+$B$KDj5A$5$l$F$$$k$b$N$N$[$+!"<!$N$b$N$,$"$j$^$9(B:
 .Pp
 .Bl -tag -width EAI_ADDRFAMILY -compact
 .It Dv EAI_ADDRFAMILY
-Address family for
 .Fa nodename
-not supported.
+$B$KBP$7$F%"%I%l%9%U%!%_%j$,%5%]!<%H$5$l$F$$$^$;$s!#(B
 .It Dv EAI_AGAIN
-Temporary failure in name resolution.
+$BL>A02r7h$,0l;~E*$K<:GT$7$^$7$?!#(B
 .It Dv EAI_BADFLAGS
-Invalid value for
-.Fa ai_flags .
+.Fa ai_flags
+$B$KIT@5$JCM$,;XDj$5$l$^$7$?!#(B
 .It Dv EAI_FAIL
-Non-recoverable failure in name resolution.
+$BL>A02r7h$GI|5lIT2DG=$J%(%i!<$,H/@8$7$^$7$?!#(B
 .It Dv EAI_FAMILY
+$B%5%]!<%H$5$l$F$$$J$$(B
 .Fa ai_family
-not supported.
+$B$,;XDj$5$l$^$7$?!#(B
 .It Dv EAI_MEMORY
-Memory allocation failure.
+$B%a%b%j$N3NJ]$K<:GT$7$^$7$?!#(B
 .It Dv EAI_NODATA
-No address associated with
-.Fa nodename .
+.Fa nodename
+$B$KBP1~$9$k%"%I%l%9$O$"$j$^$;$s!#(B
 .It Dv EAI_NONAME
 .Fa nodename
-nor
+$B$+(B
 .Fa servname
-provided, or not known.
+$B$N$I$A$i$+$,;XDj$5$l$F$$$J$$$+!"$^$?$O3:Ev$9$k$b$N$,$"$j$^$;$s!#(B
 .It Dv EAI_SERVICE
+$B;XDj$5$l$?(B
+.Fa ai_socktype
+$B$KBP$7$F(B
 .Fa servname
-not supported for
-.Fa ai_socktype .
+$B$O%5%]!<%H$5$l$F$$$^$;$s!#(B
 .It Dv EAI_SOCKTYPE
+$B;XDj$5$l$?(B
 .Fa ai_socktype
-not supported.
+$B$O%5%]!<%H$5$l$F$$$^$;$s!#(B
 .It Dv EAI_SYSTEM
-System error returned in
-.Va errno .
+$B%7%9%F%`$N%(%i!<$,(B
+.Va errno
+$B$KJV$5$l$^$7$?!#(B
 .El
 .Pp
-If called with proper argument,
 .Fn gai_strerror
-returns a pointer to a string describing the given error code.
-If the argument is not one of the
+$B$KE,@Z$J%(%i!<%3!<%I$rM?$($k$H!"$=$N0z?t$KBP1~$7$?%a%C%;!<%8$X$N(B
+$B%]%$%s%?$rF@$k$3$H$,$G$-$^$9!#(B
+$B0z?t$,(B
 .Dv EAI_xxx
-values, the function still returns a pointer to a string whose contents
-indicate an unknown error.
+$B$GDj5A$5$l$kCM$N0l$D$G$J$$>l9g!"$3$N4X?t$O!VL$CN$N%(%i!<!W$G$"$k;]$N(B
+$BJ8;zNs$X$N%]%$%s%?$rJV$7$^$9!#(B
 .\"
-.Sh SEE ALSO
+.Sh $B4XO"9`L\(B
 .Xr getnameinfo 3 ,
 .Xr gethostbyname 3 ,
 .Xr getservbyname 3 ,
@@ -588,19 +602,20 @@
 .%D June 2000
 .Re
 .\"
-.Sh HISTORY
-The implementation first appeared in WIDE Hydrangea IPv6 protocol stack kit.
+.Sh $BNr;K(B
+$B$3$l$i$N4X?t$O(B WIDE Hydrangea IPv6 $B%W%m%H%3%k%9%?%C%/%-%C%H$G;O$a$F(B
+$B<BAu$5$l$^$7$?!#(B
 .\"
-.Sh STANDARDS
-The
+.Sh $B5,3J(B
 .Fn getaddrinfo
-function is defined in
-.St -p1003.1g-2000 ,
-and documented in
+$B4X?t$O(B
+.St -p1003.1g-2000
+$B$GDj5A$5$l!"$=$N2r@b$O(B
 .Dq Basic Socket Interface Extensions for IPv6
-.Pq RFC2553 .
+.Pq RFC2553
+$B$K5-:\$5$l$F$$$^$9!#(B
 .\"
-.Sh BUGS
-The current implementation is not thread-safe.
+.Sh $B%P%0(B
+$B8=:_$N<BAu$O%9%l%C%I$KBP$7$F0BA4$G$O$"$j$^$;$s!#(B
 .Pp
-The text was shamelessly copied from RFC2553.
+$B$3$NJ8>O$O(B RFC2553 $B$N0lIt$N4]<L$7$G$9!#(B

----Next_Part(Wed_Aug_22_11:18:58_2001_756)----
