OSDN Git Service

(split) LDP: Update draft and release (from the previous commit)
[linuxjm/LDP_man-pages.git] / draft / man3 / getaddrinfo.3
index 8401ed5..feedbe8 100644 (file)
@@ -3,6 +3,7 @@
 .\" A few pieces of an earlier version remain:
 .\" Copyright 2000, Sam Varshavchik <mrsam@courier-mta.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.
@@ -22,6 +23,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: RFC 2553
 .\"
 .\" FIXME . glibc's 2.9 NEWS file documents DCCP and UDP-lite support
 .\"           and is SCTP support now also there?
 .\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
 .\" Japanese Version Copyright (c) 2001 NAKANO Takeo all rights reserved.
 .\" Translated Sun Jan 14 2001 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
 .\" Updated 2005-10-09 by Kentaro Shirakata <argrath@ub32.org>
 .\" Updated 2008-11-09, Akihiro MOTOKI, LDP v3.13
 .\" Updated 2008-12-26, Akihiro MOTOKI, LDP v3.15
 .\" Updated 2010-04-18, Akihiro MOTOKI, LDP v3.24
+.\" Updated 2012-04-30, Akihiro MOTOKI <amotoki@gmail.com>
+.\" Updated 2012-05-29, Akihiro MOTOKI <amotoki@gmail.com>
+.\" Updated 2013-05-01, Akihiro MOTOKI <amotoki@gmail.com>
 .\"
-.\"WORD:       null pointer    ¥Ì¥ë¡¦¥Ý¥¤¥ó¥¿
-.\"
-.TH GETADDRINFO 3 2009-09-03 "GNU" "Linux Programmer's Manual"
-.\"O .SH NAME
-.\"O getaddrinfo, freeaddrinfo, gai_strerror \- network address and
-.\"O service translation
-.SH Ì¾Á°
-getaddrinfo, freeaddrinfo, gai_strerror \-
-¥Í¥Ã¥È¥ï¡¼¥¯¤Î¥¢¥É¥ì¥¹¤È¥µ¡¼¥Ó¥¹¤òÊÑ´¹¤¹¤ë
-.\"O .SH SYNOPSIS
-.SH ½ñ¼°
+.TH GETADDRINFO 3 2014\-04\-06 GNU "Linux Programmer's Manual"
+.SH 名前
+getaddrinfo, freeaddrinfo, gai_strerror \- ネットワークのアドレスとサービスを変換する
+.SH 書式
 .nf
-.B #include <sys/types.h>
-.B #include <sys/socket.h>
-.B #include <netdb.h>
+\fB#include <sys/types.h>\fP
+\fB#include <sys/socket.h>\fP
+\fB#include <netdb.h>\fP
 .sp
-.BI "int getaddrinfo(const char *" "node" ", const char *" "service" ,
-.BI "                const struct addrinfo *" "hints" ,
-.BI "                struct addrinfo **" "res" );
+\fBint getaddrinfo(const char *\fP\fInode\fP\fB, const char *\fP\fIservice\fP\fB,\fP
+\fB                const struct addrinfo *\fP\fIhints\fP\fB,\fP
+\fB                struct addrinfo **\fP\fIres\fP\fB);\fP
 .sp
-.BI "void freeaddrinfo(struct addrinfo *" "res" );
+\fBvoid freeaddrinfo(struct addrinfo *\fP\fIres\fP\fB);\fP
 .sp
-.BI "const char *gai_strerror(int " "errcode" );
+\fBconst char *gai_strerror(int \fP\fIerrcode\fP\fB);\fP
 .fi
 .sp
 .in -4n
-.\"O Feature Test Macro Requirements for glibc (see
-.\"O .BR feature_test_macros (7)):
-glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
-.RB ( feature_test_macros (7)
-»²¾È):
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
 .ad l
 .in
 .sp
-.BR getaddrinfo (),
-.BR freeaddrinfo (),
-.BR gai_strerror ():
+\fBgetaddrinfo\fP(), \fBfreeaddrinfo\fP(), \fBgai_strerror\fP():
+.RS 4
 _POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE
+.RE
 .ad b
-.\"O .SH DESCRIPTION
-.SH ÀâÌÀ
-.\"O Given
-.\"O .I node
-.\"O and
-.\"O .IR service ,
-.\"O which identify an Internet host and a service,
-.\"O .BR getaddrinfo ()
-.\"O returns one or more
-.\"O .I addrinfo
-.\"O structures, each of which contains an Internet address
-.\"O that can be specified in a call to
-.\"O .BR bind (2)
-.\"O or
-.\"O .BR connect (2).
-.BR getaddrinfo ()
-¤Ï¡¢(¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Î¥Û¥¹¥È¤È¥µ¡¼¥Ó¥¹¤ò¼±Ê̤¹¤ë)
-.I node
-¤È
-.I service
-¤òÅϤ¹¤È¡¢°ì¤Ä°Ê¾å¤Î
-.I addrinfo
-¹½Â¤ÂΤòÊÖ¤¹¡£¤½¤ì¤¾¤ì¤Î
-.I addrinfo
-¹½Â¤ÂΤˤϡ¢
-.BR bind (2)
-¤ä
-.BR connect (2)
-¤ò¸Æ¤Ó½Ð¤¹ºÝ¤Ë»ØÄê¤Ç¤­¤ë¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥¢¥É¥ì¥¹¤¬³ÊǼ¤µ¤ì¤Æ¤¤¤ë¡£
-.\"O The
-.\"O .BR getaddrinfo ()
-.\"O function combines the functionality provided by the
-.\"O .\" .BR getipnodebyname (3),
-.\"O .\" .BR getipnodebyaddr (3),
-.\"O .BR getservbyname (3)
-.\"O and
-.\"O .BR getservbyport (3)
-.\"O functions into a single interface, but unlike the latter functions,
-.\"O .BR getaddrinfo ()
-.\"O is reentrant and allows programs to eliminate IPv4-versus-IPv6 dependencies.
-.BR getaddrinfo ()
-´Ø¿ô¤Ï¡¢
+.SH 説明
 .\" .BR getipnodebyname (3),
 .\" .BR getipnodebyaddr (3),
-.BR getservbyname (3)
-¤È
-.BR getservbyport (3)
-¤Îµ¡Ç½¤ò¤Þ¤È¤á¤Æ°ì¤Ä¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë¤·¤¿¤â¤Î¤Ç¤¢¤ë¤¬¡¢
-¤³¤ì¤é¤Î´Ø¿ô¤È°ã¤¤¡¢
-.BR getaddrinfo ()
-¤Ï¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤¢¤ê¡¢
-.BR getaddrinfo ()
-¤ò»È¤¦¤³¤È¤Ç¥×¥í¥°¥é¥à¤Ï IPv4 ¤È IPv6 ¤Î°ã¤¤¤Ë´Ø¤¹¤ë°Í¸´Ø·¸¤ò
-¤Ê¤¯¤¹¤³¤È¤¬¤Ç¤­¤ë¡£
+\fBgetaddrinfo\fP()  は、(インターネットのホストとサービスを識別する)  \fInode\fP と \fIservice\fP を渡すと、一つ以上の
+\fIaddrinfo\fP 構造体を返す。それぞれの \fIaddrinfo\fP 構造体には、 \fBbind\fP(2)  や \fBconnect\fP(2)
+を呼び出す際に指定できるインターネットアドレスが格納されている。 \fBgetaddrinfo\fP()  関数は、 \fBgethostbyname\fP(3)
+と \fBgetservbyname\fP(3) の機能をまとめて一つのインターフェースにしたものであるが、 これらの関数と違い、
+\fBgetaddrinfo\fP() はリエントラントであり、 \fBgetaddrinfo\fP() を使うことでプログラムは IPv4 と IPv6
+の違いに関する依存関係を なくすことができる。
 .PP
-.\"O The
-.\"O .I addrinfo
-.\"O structure used by
-.\"O .BR getaddrinfo ()
-.\"O contains the following fields:
-.BR getaddrinfo ()
-¤¬ÍѤ¤¤ë
-.I addrinfo
-¹½Â¤ÂΤϰʲ¼¤Î¥Õ¥£¡¼¥ë¥É¤ò´Þ¤à¡£
+\fBgetaddrinfo\fP()  が用いる \fIaddrinfo\fP 構造体は以下のフィールドを含む。
 .sp
 .in +4n
 .nf
@@ -160,7 +107,7 @@ struct addrinfo {
     int              ai_family;
     int              ai_socktype;
     int              ai_protocol;
-    size_t           ai_addrlen;
+    socklen_t        ai_addrlen;
     struct sockaddr *ai_addr;
     char            *ai_canonname;
     struct addrinfo *ai_next;
@@ -168,665 +115,137 @@ struct addrinfo {
 .fi
 .in
 .PP
-.\"O The
-.\"O .I hints
-.\"O argument points to an
-.\"O .I addrinfo
-.\"O structure that specifies criteria for selecting the socket address
-.\"O structures returned in the list pointed to by
-.\"O .IR res .
-.\"O If
-.\"O .I hints
-.\"O is not NULL it points to an
-.\"O .I addrinfo
-.\"O structure whose
-.\"O .IR ai_family ,
-.\"O .IR ai_socktype ,
-.\"O and
-.\"O .I ai_protocol
-.\"O specify criteria that limit the set of socket addresses returned by
-.\"O .BR getaddrinfo (),
-.\"O as follows:
-.I hints
-°ú¤­¿ô¤Ï
-.I addrinfo
-¹½Â¤ÂΤò»Ø¤·¼¨¤·¡¢¤³¤Î¹½Â¤ÂΤòÍѤ¤¤Æ
-.I res
-¤¬»Ø¤¹¥ê¥¹¥È¤ËÆþ¤ì¤ÆÊÖ¤¹¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¹½Â¤ÂΤòÁªÂò¤¹¤ë¤¿¤á¤Î´ð½à¤ò»ØÄꤹ¤ë¡£
-.I hints
-¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢
-.I hints
-¤Ï
-.I addrinfo
-¹½Â¤ÂΤò»Ø¤·¼¨¤·¡¢¤½¤Î¹½Â¤ÂΤΥե£¡¼¥ë¥É
-.IR ai_family ,
-.IR ai_socktype ,
-.I ai_protocol
-¤Ç
-.BR getaddrinfo ()
-¤¬ÊÖ¤¹¥½¥±¥Ã¥È¥¢¥É¥ì¥¹½¸¹ç¤ËÂФ¹¤ë´ð½à¤ò»ØÄꤹ¤ë¡£
-.TP 12
-.I ai_family
-.\"O This field specifies the desired address family for the returned addresses.
-.\"O Valid values for this field include
-.\"O .BR AF_INET
-.\"O and
-.\"O .BR AF_INET6 .
-.\"O The value
-.\"O .B AF_UNSPEC
-.\"O indicates that
-.\"O .BR getaddrinfo ()
-.\"O should return socket addresses for any address family
-.\"O (either IPv4 or IPv6, for example) that can be used with
-.\"O .I node
-.\"O and
-.\"O .IR service .
-¤³¤Î¥Õ¥£¡¼¥ë¥É¤ÏÊÖ¤µ¤ì¤ë¥¢¥É¥ì¥¹¤Î´õ˾¤Î¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤ò»ØÄꤹ¤ë¡£
-¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ë»ØÄê¤Ç¤­¤ëÍ­¸ú¤ÊÃͤȤ·¤Æ¤Ï
-.B AF_INET
-¤È
-.B AF_INET6
-¤¬¤¢¤ë¡£
-¤Þ¤¿¡¢ÃÍ
-.B AF_UNSPEC
-¤ò»ØÄꤹ¤ë¤È¡¢
-.BR getaddrinfo ()
-¤Ï
-.I node
-¤È
-.I service
-¤Ç»ÈÍѤǤ­¤ë¤¤¤º¤ì¤«¤Î¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼ (Î㤨¤Ð IPv4 ¤« IPv6) ¤Î
-¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤òÊÖ¤¹¤³¤È¤òµá¤á¤é¤ì¤ë¡£
-.TP
-.I ai_socktype
-.\"O This field specifies the preferred socket type, for example
-.\"O .BR SOCK_STREAM
-.\"O or
-.\"O .BR SOCK_DGRAM .
-.\"O Specifying 0 in this field indicates that socket addresses of any type
-.\"O can be returned by
-.\"O .BR getaddrinfo ().
-¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¿ä¾©¤Î¥½¥±¥Ã¥È·¿ (Î㤨¤Ð
-.B SOCK_STREAM
-¤ä
-.BR SOCK_DGRAM )
-¤ò»ØÄꤹ¤ë¡£
-¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ë 0 ¤ò»ØÄꤹ¤ë¤È¡¢Ç¤°Õ¤Î¥½¥±¥Ã¥È·¿¤Î¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤ò
-.BR getaddrinfo ()
-¤¬ÊÖ¤·¤Æ¤è¤¤¤³¤È¤ò°ÕÌ£¤¹¤ë¡£
-.TP
-.I ai_protocol
-.\"O This field specifies the protocol for the returned socket addresses.
-.\"O Specifying 0 in this field indicates that socket addresses with
-.\"O any protocol can be returned by
-.\"O .BR getaddrinfo ().
-¤³¤Î¥Õ¥£¡¼¥ë¥É¤ÏÊÖ¤µ¤ì¤ë¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Î¥×¥í¥È¥³¥ë¤ò»ØÄꤹ¤ë¡£
-¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ë 0 ¤ò»ØÄꤹ¤ë¤È¡¢Ç¤°Õ¤Î¥×¥í¥È¥³¥ë¤Î¤Î¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤ò
-.BR getaddrinfo ()
-¤¬ÊÖ¤·¤Æ¤è¤¤¤³¤È¤ò°ÕÌ£¤¹¤ë¡£
-.TP
-.I ai_flags
-.\"O This field specifies additional options, described below.
-.\"O Multiple flags are specified by logically OR-ing them together.
-¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢ÄɲäΥª¥×¥·¥ç¥ó (²¼µ­) ¤ò»ØÄꤹ¤ë¡£
-Ê£¿ô¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ëºÝ¤Ë¤Ï¡¢¤½¤ì¤é¤ÎÏÀÍý OR ¤ò¤È¤Ã¤Æ»ØÄꤹ¤ë¡£
+\fIhints\fP 引き数は \fIaddrinfo\fP 構造体を指し示し、この構造体を用いて \fIres\fP
+が指すリストに入れて返すソケットアドレス構造体を選択するための基準を指定する。 \fIhints\fP が NULL でない場合、 \fIhints\fP は
+\fIaddrinfo\fP 構造体を指し示し、その構造体のフィールド \fIai_family\fP, \fIai_socktype\fP,
+\fIai_protocol\fP で \fBgetaddrinfo\fP()  が返すソケットアドレス集合に対する基準を指定する。
+.TP  12
+\fIai_family\fP
+このフィールドは返されるアドレスの希望のアドレスファミリーを指定する。 このフィールドに指定できる有効な値としては \fBAF_INET\fP と
+\fBAF_INET6\fP がある。 また、値 \fBAF_UNSPEC\fP を指定すると、 \fBgetaddrinfo\fP()  は \fInode\fP と
+\fIservice\fP で使用できるいずれかのアドレスファミリー (例えば IPv4 か IPv6) の ソケットアドレスを返すことを求められる。
+.TP 
+\fIai_socktype\fP
+このフィールドは推奨のソケット型 (例えば \fBSOCK_STREAM\fP や \fBSOCK_DGRAM\fP)  を指定する。 このフィールドに 0
+を指定すると、任意のソケット型のソケットアドレスを \fBgetaddrinfo\fP()  が返してよいことを意味する。
+.TP 
+\fIai_protocol\fP
+このフィールドは返されるソケットアドレスのプロトコルを指定する。 このフィールドに 0 を指定すると、任意のプロトコルののソケットアドレスを
+\fBgetaddrinfo\fP()  が返してよいことを意味する。
+.TP 
+\fIai_flags\fP
+このフィールドは、追加のオプション (下記) を指定する。 複数のフラグを指定する際には、それらのビット単位の OR をとって指定する。
 .PP
-.\"O All the other fields in the structure pointed to by
-.\"O .I hints
-.\"O must contain either 0 or a null pointer, as appropriate.
-.I hints
-¤¬»Ø¤·¼¨¤¹¹½Â¤ÂΤξ¤Î¤¹¤Ù¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤Ë¤Ï
-0 ¤« NULL ¥Ý¥¤¥ó¥¿¤òŬÀÚ¤ËÆþ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
-.\"O Specifying
-.\"O .I hints
-.\"O as NULL is equivalent to setting
-.\"O .I ai_socktype
-.\"O and
-.\"O .I ai_protocol
-.\"O to 0;
-.\"O .I ai_family
-.\"O to
-.\"O .BR AF_UNSPEC ;
-.\"O and
-.\"O .I ai_flags
-.\"O to
-.\"O .BR "(AI_V4MAPPED\ |\ AI_ADDRCONFIG)" .
-.I hints
-¤Ë NULL ¤ò»ØÄꤹ¤ë¤Î¤Ï¡¢
-.I ai_socktype
-¤È
-.I ai_protocol
-¤Ë 0 ¤ò¡¢
-.I ai_family
-¤Ë
-.B AF_UNSPEC
-¤ò¡¢
-.I ai_flags
-¤Ë
-.B "(AI_V4MAPPED\ |\ AI_ADDRCONFIG)"
-¤òÀßÄꤹ¤ë¤Î¤ÈÅù²Á¤Ç¤¢¤ë¡£
-
-.\"O .I node
-.\"O specifies either a numerical network address
-.\"O (for IPv4, numbers-and-dots notation as supported by
-.\"O .BR inet_aton (3);
-.\"O for IPv6, hexadecimal string format as supported by
-.\"O .BR inet_pton (3)),
-.\"O or a network hostname, whose network addresses are looked up and resolved.
-.\"O If
-.\"O .I hints.ai_flags
-.\"O contains the
-.\"O .B AI_NUMERICHOST
-.\"O flag then
-.\"O .I node
-.\"O must be a numerical network address.
-.\"O The
-.\"O .B AI_NUMERICHOST
-.\"O flag suppresses any potentially lengthy network host address lookups.
-.I node
-¤Ë¤Ï¡¢¿ôÃÍ·Á¼°¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹
-(IPv4 ¤Î¾ì¹ç¤Ï
-.BR inet_aton (3)
-¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥É¥Ã¥È¶èÀÚ¤ê¤Î¿ô»ú¤Ë¤è¤ëɽµ­¡¢
-IPv6 ¤Î¾ì¹ç¤Ï
-.BR inet_pton (3)
-¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë 16 ¿Ê¿ô¤Îʸ»úÎó·Á¼°) ¤â¤·¤¯¤Ï
-¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È̾¤ò»ØÄꤹ¤ë¡£
-¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È̾¤ò»ØÄꤷ¤¿¾ì¹ç¤Ë¤Ï¡¢¤½¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤¬¸¡º÷¤µ¤ì¡¢
-̾Á°²ò·è¤¬¹Ô¤Ê¤ï¤ì¤ë¡£
-.I hints.ai_flags
-¤Ë
-.B AI_NUMERICHOST
-¥Õ¥é¥°¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢
-.I node
-¤Ï¿ôÃÍ·Á¼°¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
-.B AI_NUMERICHOST
-¥Õ¥é¥°¤ò»È¤¦¤È¡¢»þ´Ö¤Î³Ý¤«¤ë²ÄǽÀ­¤Î¤¢¤ë¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¥¢¥É¥ì¥¹¤Î¸¡º÷¤Ï
-¤¹¤Ù¤ÆÍÞÀ©¤µ¤ì¤ë¡£
+\fIhints\fP が指し示す構造体の他のすべてのフィールドには 0 か NULL ポインタを適切に入れなければならない。
 .PP
-.\"O If the
-.\"O .B AI_PASSIVE
-.\"O flag is specified in
-.\"O .IR hints.ai_flags ,
-.\"O and
-.\"O .I node
-.\"O is NULL,
-.\"O then the returned socket addresses will be suitable for
-.\"O .BR bind (2)ing
-.\"O a socket that will
-.\"O .BR accept (2)
-.\"O connections.
-.\"O The returned socket address will contain the "wildcard address"
-.\"O .RB ( INADDR_ANY
-.\"O for IPv4 addresses,
-.\"O .BR IN6ADDR_ANY_INIT
-.\"O for IPv6 address).
-.\"O The wildcard address is used by applications (typically servers)
-.\"O that intend to accept connections on any of the hosts's network addresses.
-.\"O If
-.\"O .I node
-.\"O is not NULL, then the
-.\"O .B AI_PASSIVE
-.\"O flag is ignored.
-.IR hints.ai_flags
-¤Ë
-.B AI_PASSIVE
-¥Õ¥é¥°¤¬»ØÄꤵ¤ì¡¢¤«¤Ä
-.I node
-¤¬ NULL ¤Î¾ì¹ç¡¢
-ÊÖ¤µ¤ì¤ë¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Ï
-¥³¥Í¥¯¥·¥ç¥ó¤ò
-.BR accept (2)
-¤¹¤ë¤¿¤á¤Î¥½¥±¥Ã¥È¤ò
-.BR bind (2)
-¤¹¤ë¤Î¤ËŬ¤·¤¿¤â¤Î¤È¤Ê¤ë¡£
-ÊÖ¤µ¤ì¤ë¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Ë¤Ï¡Ö¥ï¥¤¥ë¥É¥«¡¼¥É¡¦¥¢¥É¥ì¥¹¡×
-(IPv4 ¥¢¥É¥ì¥¹¤Î¾ì¹ç¤Ï
-.BR INADDR_ANY ¡¢
-IPv6 ¥¢¥É¥ì¥¹¤Î¾ì¹ç¤Ï
-.BR IN6ADDR_ANY_INIT )
-¤¬Æþ¤ë¡£
-¥ï¥¤¥ë¥É¥«¡¼¥É¡¦¥¢¥É¥ì¥¹¤Ï¡¢Ç¤°Õ¤Î¥Û¥¹¥È¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤ÇÀܳ¤ò
-¼õ¤±ÉÕ¤±¤è¤¦¤È¤¹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó (Ä̾ï¤Ï¥µ¡¼¥Ð¡¼) ¤ÇÍѤ¤¤é¤ì¤ë¡£
-.I node
-¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢
-.B AI_PASSIVE
-¥Õ¥é¥°¤Ï̵»ë¤µ¤ì¤ë¡£
+\fIhints\fP に NULL を指定するのは、 \fIai_socktype\fP と \fIai_protocol\fP に 0 を、 \fIai_family\fP
+に \fBAF_UNSPEC\fP を、 \fIai_flags\fP に \fB(AI_V4MAPPED\ |\ AI_ADDRCONFIG)\fP
+を設定するのと等価である (POSIX では \fIai_flags\fP には別のデフォルト値が規定されている; 「備考」を参照)。 \fInode\fP
+には、数値形式のネットワークアドレス (IPv4 の場合は \fBinet_aton\fP(3)  でサポートされているドット区切りの数字による表記、
+IPv6 の場合は \fBinet_pton\fP(3)  でサポートされている 16 進数の文字列形式) もしくは ネットワークホスト名を指定する。
+ネットワークホスト名を指定した場合には、そのネットワークアドレスが検索され、 名前解決が行なわれる。 \fIhints.ai_flags\fP に
+\fBAI_NUMERICHOST\fP フラグが含まれている場合は、 \fInode\fP は数値形式のネットワークアドレスでなければならない。
+\fBAI_NUMERICHOST\fP フラグを使うと、時間の掛かる可能性のあるネットワークホストアドレスの検索は すべて抑制される。
 .PP
-.\"O If the
-.\"O .B AI_PASSIVE
-.\"O flag is not set in
-.\"O .IR hints.ai_flags ,
-.\"O then the returned socket addresses will be suitable for use with
-.\"O .BR connect (2),
-.\"O .BR sendto (2),
-.\"O or
-.\"O .BR sendmsg (2).
-.\"O If
-.\"O .I node
-.\"O is NULL,
-.\"O then the network address will be set to the loopback interface address
-.\"O .RB ( INADDR_LOOPBACK
-.\"O for IPv4 addresses,
-.\"O .BR IN6ADDR_LOOPBACK_INIT
-.\"O for IPv6 address);
-.\"O this is used by applications that intend to communicate
-.\"O with peers running on the same host.
-.I hints.ai_flags
-¤Ë
-.B AI_PASSIVE
-¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢
-ÊÖ¤µ¤ì¤ë¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Ï
-.BR connect (2),
-.BR sendto (2),
-.BR sendmsg (2)
-¤Ç¤Î»ÈÍѤËŬ¤·¤¿¤â¤Î¤È¤Ê¤ë¡£
-.I node
-¤¬ NULL ¤Î¾ì¹ç¡¢¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤Ë¤Ï¥ë¡¼¥×¥Ð¥Ã¥¯¡¦¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Î
-¥¢¥É¥ì¥¹ (IPv4 ¥¢¥É¥ì¥¹¤Î¾ì¹ç¤Ï
-.BR INADDR_LOOPBACK
-IPv6 ¥¢¥É¥ì¥¹¤Î¾ì¹ç¤Ï
-.BR IN6ADDR_LOOPBACK_INIT ) ¤¬ÀßÄꤵ¤ì¤ë¡£
-¤³¤ì¤ÏƱ¤¸¥Û¥¹¥È¾å¤ÇÆ°ºî¤·¤Æ¤¤¤ëÀܳÁê¼ê¤ÈÄÌ¿®¤¹¤ë¤è¤¦¤Ê
-¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÇÍѤ¤¤é¤ì¤ë¡£
+\fIhints.ai_flags\fP に \fBAI_PASSIVE\fP フラグが指定され、かつ \fInode\fP が NULL の場合、
+返されるソケットアドレスは コネクションを \fBaccept\fP(2)  するためのソケットを \fBbind\fP(2)  するのに適したものとなる。
+返されるソケットアドレスには「ワイルドカード・アドレス」 (IPv4 アドレスの場合は \fBINADDR_ANY\fP、 IPv6 アドレスの場合は
+\fBIN6ADDR_ANY_INIT\fP)  が入る。 ワイルドカード・アドレスは、任意のホストのネットワークアドレスで接続を
+受け付けようとするアプリケーション (通常はサーバー) で用いられる。 \fInode\fP が NULL でない場合、 \fBAI_PASSIVE\fP
+フラグは無視される。
 .PP
-.\"O .I service
-.\"O sets the port in each returned address structure.
-.\"O If this argument is a service name (see
-.\"O .BR services (5)),
-.\"O it is translated to the corresponding port number.
-.\"O This argument can also be specified as a decimal number,
-.\"O which is simply converted to binary.
-.I service
-¤Ë¤è¤ê¡¢ÊÖ¤µ¤ì¤ë³Æ¥¢¥É¥ì¥¹¹½Â¤ÂΤΥݡ¼¥ÈÈֹ椬·è¤Þ¤ë¡£
-¤³¤Î°ú¤­¿ô¤¬¥µ¡¼¥Ó¥¹Ì¾
-.RB ( services (5)
-»²¾È) ¤Î¾ì¹ç¡¢Âбþ¤¹¤ë¥Ý¡¼¥ÈÈÖ¹æ¤ËËÝÌõ¤µ¤ì¤ë¡£
-¤³¤Î°ú¤­¿ô¤Ë¤Ï 10 ¿Ê¿ô¤â»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¡¢
-¤³¤Î¾ì¹ç¤Ë¤Ï¥Ð¥¤¥Ê¥ê¤Ø¤ÎÊÑ´¹¤À¤±¤¬¹Ô¤ï¤ì¤ë¡£
-.\"O If
-.\"O .I service
-.\"O is NULL, then the port number of the returned socket addresses
-.\"O will be left uninitialized.
-.I service
-¤¬ NULL ¤Î¾ì¹ç¡¢ÊÖ¤µ¤ì¤ë¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Î¥Ý¡¼¥ÈÈÖ¹æ¤Ï
-½é´ü²½¤µ¤ì¤Ê¤¤¤Þ¤Þ¤È¤Ê¤ë¡£
-.\"O If
-.\"O .B AI_NUMERICSERV
-.\"O is specified in
-.\"O .I hints.ai_flags
-.\"O and
-.\"O .I service
-.\"O is not NULL, then
-.\"O .I service
-.\"O must point to a string containing a numeric port number.
-.I hints.ai_flags
-¤Ë
-.B AI_NUMERICSERV
-¤¬»ØÄꤵ¤ì¡¢¤«¤Ä
-.I service
-¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢
-.I service
-¤Ï¿ôÃͤΥݡ¼¥ÈÈÖ¹æ¤ò´Þ¤àʸ»úÎó¤ò»Ø¤·¼¨¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
-.\"O This flag is used to inhibit the invocation of a name resolution service
-.\"O in cases where it is known not to be required.
-¤³¤Î¥Õ¥é¥°¤Ï¡¢Ì¾Á°²ò·è¥µ¡¼¥Ó¥¹¤¬ÉÔÍפǤ¢¤ë¤³¤È¤¬Ê¬¤«¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢
-¥µ¡¼¥Ó¥¹¤Îµ¯Æ°¤òÍÞÀ©¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£
+\fIhints.ai_flags\fP に \fBAI_PASSIVE\fP フラグがセットされていない場合、 返されるソケットアドレスは
+\fBconnect\fP(2), \fBsendto\fP(2), \fBsendmsg\fP(2)  での使用に適したものとなる。 \fInode\fP が NULL
+の場合、ネットワークアドレスにはループバック・インターフェイスの アドレス (IPv4 アドレスの場合は \fBINADDR_LOOPBACK\fP IPv6
+アドレスの場合は \fBIN6ADDR_LOOPBACK_INIT\fP)\fBが設定される。\fP これは同じホスト上で動作している接続相手と通信するような
+アプリケーションで用いられる。
 .PP
-.\"O Either
-.\"O .I node
-.\"O or
-.\"O .IR service ,
-.\"O but not both, may be NULL.
-.I node
-¤È
-.I service
-¤Î¤É¤Á¤é¤«¤Ï NULL ¤Ë¤·¤Æ¤è¤¤¤¬¡¢Î¾ÊýƱ»þ¤Ë NULL ¤Ë¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
+\fIservice\fP により、返される各アドレス構造体のポート番号が決まる。 この引き数がサービス名 (\fBservices\fP(5)  参照)
+の場合、対応するポート番号に翻訳される。 この引き数には 10 進数も指定することができ、 この場合にはバイナリへの変換だけが行われる。
+\fIservice\fP が NULL の場合、返されるソケットアドレスのポート番号は 初期化されないままとなる。 \fIhints.ai_flags\fP に
+\fBAI_NUMERICSERV\fP が指定され、かつ \fIservice\fP が NULL でない場合、 \fIservice\fP
+は数値のポート番号を含む文字列を指し示さなければならない。 このフラグは、名前解決サービスが不要であることが分かっている場合に、
+サービスの起動を抑制するために用いられる。
 .PP
-.\"O The
-.\"O .BR getaddrinfo ()
-.\"O function allocates and initializes a linked list of
-.\"O .I addrinfo
-.\"O structures, one for each network address that matches
-.\"O .I node
-.\"O and
-.\"O .IR service ,
-.\"O subject to any restrictions imposed by
-.\"O .IR hints ,
-.\"O and returns a pointer to the start of the list in
-.\"O .IR res .
-.\"O The items in the linked list are linked by the
-.\"O .I ai_next
-.\"O field.
-.BR getaddrinfo ()
-´Ø¿ô¤Ï¡¢
-.I addrinfo
-¹½Â¤ÂΤΥá¥â¥ê³ÎÊݤò¹Ô¤¤¡¢
-.I addrinfo
-¹½Â¤ÂΤΥê¥ó¥¯¥ê¥¹¥È¤ò½é´ü²½¤·¡¢
-.I res
-¤Ë¥ê¥¹¥È¤ÎÀèƬ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÆþ¤ì¤ÆÊÖ¤¹¡£
-¤³¤Î¤È¤­¡¢³Æ¹½Â¤ÂΤΥͥåȥ¥¯¥¢¥É¥ì¥¹¤Ï
-.I node
-¤È
-.I service
-¤Ë°ìÃפ·¡¢
-.I hints
-¤Ç²Ý¤µ¤ì¤¿¤¹¤Ù¤Æ¤ÎÀ©¸Â¤òËþ¤¿¤¹¤â¤Î¤È¤Ê¤ë¡£
-¥ê¥ó¥¯¥ê¥¹¥È¤ÎÍ×ÁǤÏ
-.I ai_next
-¥Õ¥£¡¼¥ë¥É¤Ë¤è¤êÏ¢·ë¤µ¤ì¤ë¡£
-
-.\"O There are several reasons why
-.\"O the linked list may have more than one
-.\"O .I addrinfo
-.\"O structure, including: the network host is multihomed, accessible
-.\"O over multiple protocols (e.g. both
-.\"O .BR AF_INET
-.\"O and
-.\"O .BR AF_INET6 );
-.\"O or the same service is available from multiple socket types (one
-.\"O .B SOCK_STREAM
-.\"O address and another
-.\"O .B SOCK_DGRAM
-.\"O address, for example).
-¥ê¥ó¥¯¥ê¥¹¥È¤Î
-.I addrinfo
-¹½Â¤ÂΤÏÊ£¿ô¸Ä¤Ë¤Ê¤ë¤³¤È¤â¤¢¤ê¡¢¤½¤ÎÍýͳ¤Ï¤¤¤¯¤Ä¤«¤¢¤ë¡£
-¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤¬¥Þ¥ë¥Á¥Û¡¼¥à¤Ç¤¢¤ë¡¢
-Ê£¿ô¤Î¥×¥í¥È¥³¥ë¤Ç¥¢¥¯¥»¥¹¤Ç¤­¤ë (Î㤨¤Ð
-.B AF_INET
-¤È
-.B AF_INET6
-¤ÎξÊý) ¡¢
-Ê£¿ô¤Î¥½¥±¥Ã¥È¼ïÊ̤ÇƱ¤¸¥µ¡¼¥Ó¥¹¤¬ÍøÍѤǤ­¤ë
-(Î㤨¤Ð¡¢¤Ò¤È¤Ä¤¬
-.B SOCK_STREM
-¥¢¥É¥ì¥¹¤Ç¡¢¤â¤¦¤Ò¤È¤Ä¤¬
-.B SOCK_DGRAM
-¥¢¥É¥ì¥¹¤Ç¤¢¤ë)¡¢¤¬¤¢¤ë¡£
-.\"O Normally, the application should try
-.\"O using the addresses in the order in which they are returned.
-.\"O The sorting function used within
-.\"O .BR getaddrinfo ()
-.\"O is defined in RFC\ 3484; the order can be tweaked for a particular
-.\"O system by editing
-.\"O .IR /etc/gai.conf
-.\"O (available since glibc 2.5).
-Ä̾ï¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÏÊÖ¤µ¤ì¤¿½ç½ø¤Ç¥¢¥É¥ì¥¹¤ò»î¤¹¤Ù¤­¤Ç¤¢¤ë¡£
-.BR getaddrinfo ()
-¤ÎÃæ¤Ç»ÈÍѤµ¤ì¤ëʤÙÂؤ¨´Ø¿ô¤Ï RFC\ 3484 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
-Æüì¤Ê¥·¥¹¥Æ¥à¤Ç¤Ï¡¢
-.I /etc/gai.conf
-¤òÊÔ½¸¤¹¤ë¤³¤È¤Ç¡¢¤³¤Î½ç½ø¤òÈùÄ´À°¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë
-.RI ( /etc/gai.conf
-¤Ï glibc 2.5 °Ê¹ß¤ÇÍøÍѤǤ­¤ë)¡£
+\fInode\fP と \fIservice\fP のどちらかは NULL にしてよいが、両方同時に NULL にしてはならない。
+.PP
+\fBgetaddrinfo\fP()  関数は、 \fIaddrinfo\fP 構造体のメモリ確保を行い、 \fIaddrinfo\fP
+構造体のリンクリストを初期化し、 \fIres\fP にリストの先頭へのポインタを入れて返す。 このとき、各構造体のネットワークアドレスは \fInode\fP と
+\fIservice\fP に一致し、 \fIhints\fP で課されたすべての制限を満たすものとなる。 リンクリストの要素は \fIai_next\fP
+フィールドにより連結される。
+
+リンクリストの \fIaddrinfo\fP 構造体は複数個になることもあり、その理由はいくつかある。 ネットワークホストがマルチホームである、
+複数のプロトコルでアクセスできる (例えば \fBAF_INET\fP と \fBAF_INET6\fP の両方) 、 複数のソケット種別で同じサービスが利用できる
+(例えば、ひとつが \fBSOCK_STREM\fP アドレスで、もうひとつが \fBSOCK_DGRAM\fP アドレスである)、がある。
+通常は、アプリケーションは返された順序でアドレスを試すべきである。 \fBgetaddrinfo\fP()  の中で使用される並べ替え関数は RFC\ 3484 で定義されている。 特殊なシステムでは、 \fI/etc/gai.conf\fP を編集することで、この順序を微調整することができる
+(\fI/etc/gai.conf\fP は glibc 2.5 以降で利用できる)。
 .PP
-.\"O If
-.\"O .I hints.ai_flags
-.\"O includes the
-.\"O .B AI_CANONNAME
-.\"O flag, then the
-.\"O .I ai_canonname
-.\"O field of the first of the
-.\"O .I addrinfo
-.\"O structures in the returned list is set to point to the
-.\"O official name of the host.
-.I hints.ai_flags
-¤Ë
-.B AI_CANONNAME
-¥Õ¥é¥°¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ÊÖ¤µ¤ì¤ë¥ê¥¹¥È¤ÎºÇ½é¤Î
-.I addrinfo
-¹½Â¤ÂΤÎ
-.I ai_canonname
-¥Õ¥£¡¼¥ë¥É¤Ï¥Û¥¹¥È¤Î¸ø¼°¤Ê̾Á°¤ò»Ø¤¹¤è¤¦¤ËÀßÄꤵ¤ì¤ë¡£
 .\" In glibc prior to 2.3.4, the ai_canonname of each addrinfo
 .\" structure was set pointing to the canonical name; that was
 .\" more than POSIX.1-2001 specified, or other implementations provided.
 .\" MTK, Aug 05
+\fIhints.ai_flags\fP に \fBAI_CANONNAME\fP フラグが含まれている場合、返されるリストの最初の \fIaddrinfo\fP
+構造体の \fIai_canonname\fP フィールドはホストの公式な名前を指すように設定される。
 
-.\"O The remaining fields of each returned
-.\"O .I addrinfo
-.\"O structure are initialized as follows:
-ÊÖ¤µ¤ì¤ë³Æ¡¹¤Î
-.I addrinfo
-¹½Â¤ÂΤλĤê¤Î¥Õ¥£¡¼¥ë¥É¤Ï°Ê²¼¤Î¤è¤¦¤Ë½é´ü²½¤µ¤ì¤ë¡£
+返される各々の \fIaddrinfo\fP 構造体の残りのフィールドは以下のように初期化される。
 .IP * 2
-.\"O The
-.\"O .IR ai_family ,
-.\"O .IR ai_socktype ,
-.\"O and
-.\"O .I ai_protocol
-.\"O fields return the socket creation parameters (i.e., these fields have
-.\"O the same meaning as the corresponding arguments of
-.\"O .BR socket (2)).
-.IR ai_family ,
-.IR ai_socktype ,
-.I ai_protocol
-¥Õ¥£¡¼¥ë¥É¤Ï¥½¥±¥Ã¥ÈÀ¸À®¥Ñ¥é¥á¡¼¥¿¤òÊÖ¤¹
-(¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤Î°ÕÌ£¤Ï
-.BR socket (2)
-¤ÎƱ¤¸Ì¾Á°¤Î°ú¤­¿ô¤ÈƱ¤¸¤Ç¤¢¤ë)¡£
-.\"O For example,
-.\"O .I ai_family
-.\"O might return
-.\"O .B AF_INET
-.\"O or
-.\"O .BR AF_INET6 ;
-.\"O .I ai_socktype
-.\"O might return
-.\"O .B SOCK_DGRAM
-.\"O or
-.\"O .BR SOCK_STREAM ;
-.\"O and
-.\"O .I ai_protocol
-.\"O returns the protocol for the socket.
-Î㤨¤Ð¡¢
-.I ai_family
-¤Ï
-.B AF_INET
-¤ä
-.B AF_INET6
-¤òÊÖ¤·¡¢
-.I ai_socktype
-¤Ï
-.B SOCK_DGRAM
-¤ä
-.BR SOCK_STREAM
-¤òÊÖ¤·¡¢
-.I ai_protocol
-¤Ï¤½¤Î¥½¥±¥Ã¥È¤Î¥×¥í¥È¥³¥ë¤òÊÖ¤¹¡£
+\fIai_family\fP, \fIai_socktype\fP, \fIai_protocol\fP フィールドはソケット生成パラメータを返す
+(これらのフィールドの意味は \fBsocket\fP(2)  の同じ名前の引き数と同じである)。 例えば、 \fIai_family\fP は
+\fBAF_INET\fP や \fBAF_INET6\fP を返し、 \fIai_socktype\fP は \fBSOCK_DGRAM\fP や
+\fBSOCK_STREAM\fP を返し、 \fIai_protocol\fP はそのソケットのプロトコルを返す。
 .IP *
-.\"O A pointer to the socket address is placed in the
-.\"O .I ai_addr
-.\"O field, and the length of the socket address, in bytes,
-.\"O is placed in the
-.\"O .I ai_addrlen
-.\"O field.
-.I ai_addr
-¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬½ñ¤­¹þ¤Þ¤ì¡¢
-.I ai_addrlen
-¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤ÎŤµ¤¬¥Ð¥¤¥Èñ°Ì¤Ç½ñ¤­¹þ¤Þ¤ì¤ë¡£
+\fIai_addr\fP フィールドにはソケットアドレスへのポインタが書き込まれ、 \fIai_addrlen\fP
+フィールドにはソケットアドレスの長さがバイト単位で書き込まれる。
 .PP
-.\"O If
-.\"O .I hints.ai_flags
-.\"O includes the
-.\"O .B AI_ADDRCONFIG
-.\"O flag, then IPv4 addresses are returned in the list pointed to by
-.\"O .I res
-.\"O only if the local system has at least one
-.\"O IPv4 address configured, and IPv6 addresses are only returned
-.\"O if the local system has at least one IPv6 address configured.
-.I hints.ai_flags
-¤¬
-.B AI_ADDRCONFIG
-¤ò´Þ¤à¾ì¹ç¡¢
-.I res
-¤¬»Ø¤¹¥ê¥¹¥È¤Ë¤Ï¡¢
-¥í¡¼¥«¥ë¥·¥¹¥Æ¥à¤ËºÇÄã°ì¤Ä¤Î IPv4 ¥¢¥É¥ì¥¹¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï
-IPv4 ¥¢¥É¥ì¥¹¤¬ÊÖ¤µ¤ì¡¢
-¥í¡¼¥«¥ë¥·¥¹¥Æ¥à¤ËºÇÄã°ì¤Ä¤Î IPv6 ¥¢¥É¥ì¥¹¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï
-IPv6 ¥¢¥É¥ì¥¹¤¬ÊÖ¤µ¤ì¤ë¡£
+\fIhints.ai_flags\fP が \fBAI_ADDRCONFIG\fP を含む場合、 \fIres\fP が指すリストには、ローカルシステムに最低一つの
+IPv4 アドレスが設定されている場合のみ IPv4 アドレスが返され、 ローカルシステムに最低一つの IPv6 アドレスが設定されている場合にのみ
+IPv6 アドレスが返される。 なお、この場合には、ループバックアドレスは有効に設定されたアドレスとはみなされない。 このフラグは、例えば、IPv4
+だけのシステムで、 \fBgetaddrinfo\fP() が必ず IPv6 ソケットアドレスを返さないことを保証するのに役立つ。 IPv4
+だけのシステムでは、IPv6 アドレスは \fBconnect\fP(2) や \fBbind\fP(2) で必ず失敗することになる。
 .PP
-.\"O If
-.\"O .I hint.ai_flags
-.\"O specifies the
-.\"O .B AI_V4MAPPED
-.\"O flag, and
-.\"O .I hints.ai_family
-.\"O was specified as
-.\"O .BR AF_INET6 ,
-.\"O and no matching IPv6 addresses could be found,
-.\"O then return IPv4-mapped IPv6 addresses in the list pointed to by
-.\"O .IR res .
-.I hint.ai_flags
-¤Ë
-.B AI_V4MAPPED
-¤¬»ØÄꤵ¤ì¤Æ¤¤¤Æ¡¢
-.I hints.ai_family
-¤Ë
-.B AF_INET6
-¤¬»ØÄꤵ¤ì¡¢
-¥Þ¥Ã¥Á¤¹¤ë IPv6 ¥¢¥É¥ì¥¹¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¡¢
-.I res
-¤¬»Ø¤¹¥ê¥¹¥È¤Ë¤Ï IPv4-mapped IPv6 ¥¢¥É¥ì¥¹¤¬ÊÖ¤µ¤ì¤ë¡£
-.\"O If both
-.\"O .B AI_V4MAPPED
-.\"O and
-.\"O .B AI_ALL
-.\"O are specified in
-.\"O .IR hints.ai_family ,
-.\"O then return both IPv6 and IPv4-mapped IPv6 addresses
-.\"O in the list pointed to by
-.\"O .IR res .
-.I hints.ai_family
-¤Ë
-.B AI_V4MAPPED
-¤È
-.B AI_ALL
-¤ÎξÊý¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢
-.I res
-¤¬»Ø¤¹¥ê¥¹¥È¤Ë¤Ï IPv6 ¥¢¥É¥ì¥¹¤È IPv4-mapped IPv6 ¥¢¥É¥ì¥¹¤Î
-ξÊý¤¬ÊÖ¤µ¤ì¤ë¡£
-.\"O .B AI_ALL
-.\"O is ignored if
-.\"O .B AI_V4MAPPED
-.\"O is not also specified.
-.B AI_V4MAPPED
-¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢
-.B AI_ALL
-¤Ï̵»ë¤µ¤ì¤ë¡£
+\fIhints.ai_flags\fP に \fBAI_V4MAPPED\fP が指定されていて、 \fIhints.ai_family\fP に
+\fBAF_INET6\fP が指定され、 マッチする IPv6 アドレスが見つからなかった場合、 \fIres\fP が指すリストには IPv4\-mapped
+IPv6 アドレスが返される。 \fIhints.ai_flags\fP に \fBAI_V4MAPPED\fP と \fBAI_ALL\fP
+の両方が指定されている場合、 \fIres\fP が指すリストには IPv6 アドレスと IPv4\-mapped IPv6 アドレスの 両方が返される。
+\fBAI_V4MAPPED\fP が指定されていない場合、 \fBAI_ALL\fP は無視される。
 .PP
-.\"O The
-.\"O .BR freeaddrinfo ()
-.\"O function frees the memory that was allocated
-.\"O for the dynamically allocated linked list
-.\"O .IR res .
-.BR freeaddrinfo ()
-´Ø¿ô¤Ï¡¢
-¥ê¥ó¥¯¥ê¥¹¥È
-.I res
-¤ËÂФ·¤ÆưŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤ò²òÊü¤¹¤ë¡£
-.\"O .SS "Extensions to getaddrinfo() for Internationalized Domain Names"
-.SS "¹ñºÝ²½¥É¥á¥¤¥ó̾¤Î¤¿¤á¤Î getaddrinfo() ¤Î³ÈÄ¥"
+\fBfreeaddrinfo\fP()  関数は、 リンクリスト \fIres\fP に対して動的に割り当てられたメモリを解放する。
+.SS "国際化ドメイン名のための getaddrinfo() の拡張"
 .PP
-.\"O Starting with glibc 2.3.4,
-.\"O .BR getaddrinfo ()
-.\"O has been extended to selectively allow the incoming and outgoing
-.\"O hostnames to be transparently converted to and from the
-.\"O Internationalized Domain Name (IDN) format (see RFC 3490,
-.\"O .IR "Internationalizing Domain Names in Applications (IDNA)" ).
-.\"O Four new flags are defined:
-glibc 2.3.4 ¤«¤é¡¢
-.BR getaddrinfo ()
-¤ÏÆþ½ÐÎϤ¹¤ë¥Û¥¹¥È̾¤òÆ©²áŪ¤Ë¹ñºÝ²½¥É¥á¥¤¥ó̾ (IDN) ·Á¼° (RFC 3490 ¤Î
-.I "Internationalizing Domain Names in Applications (IDNA)"
-¤ò»²¾È¤Î¤³¤È) ¤ÈÊÑ´¹¤¹¤ë¤³¤È¤òÁªÂòŪ¤Ëǧ¤á¤ë¤è¤¦¤Ë³ÈÄ¥¤µ¤ì¤Æ¤¤¤ë¡£
-4 ¤Ä¤Î¿·¤·¤¤¥Õ¥é¥°¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë:
-.TP
-.B AI_IDN
-.\"O If this flag is specified, then the node name given in
-.\"O .I node
-.\"O is converted to IDN format if necessary.
-.\"O The source encoding is that of the current locale.
-¤³¤Î¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤ë¤È¡¢
-.I node
-¤ÇÍ¿¤¨¤é¤ì¤¿¥Î¡¼¥É̾¤ÏɬÍפ¬¤¢¤ì¤Ð IDN ·Á¼°¤ËÊÑ´¹¤µ¤ì¤ë¡£
-¥½¡¼¥¹Éä¹æ²½·Á¼°¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î¤â¤Î¤Ç¤¢¤ë¡£
+glibc 2.3.4 から、 \fBgetaddrinfo\fP()  は入出力するホスト名を透過的に国際化ドメイン名 (IDN) 形式 (RFC 3490
+の \fIInternationalizing Domain Names in Applications (IDNA)\fP を参照のこと)
+と変換することを選択的に認めるように拡張されている。 4 つの新しいフラグが定義されている:
+.TP 
+\fBAI_IDN\fP
+このフラグが指定されると、 \fInode\fP で与えられたノード名は必要があれば IDN 形式に変換される。
+ソース符号化形式は現在のロケールのものである。
 
-.\"O If the input name contains non-ASCII characters, then the IDN encoding
-.\"O is used.
-.\"O Those parts of the node name (delimited by dots) that contain
-.\"O non-ASCII characters are encoded using ASCII Compatible Encoding (ACE)
-.\"O before being passed to the name resolution functions.
-ÆþÎÏ̾¤ËÈó ASCII Ê¸»ú¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢
-IDN Éä¹æ²½·Á¼°¤¬»È¤ï¤ì¤ë¡£
-Èó ASCII Ê¸»ú¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë(¥Ô¥ê¥ª¥É¤Ç¶èÀÚ¤é¤ì¤ë)Éôʬ¥Î¡¼¥É̾¤Ï¡¢
-̾Á°²ò·èµ¡Ç½¤ËÅϤµ¤ì¤ëÁ°¤Ë ASCII ¸ß´¹Éä¹æ²½·Á¼° (ACE) ¤ò»È¤Ã¤Æ
-Éä¹æ²½¤µ¤ì¤ë¡£
 .\" Implementation Detail:
 .\" To minimize effects on system performance the implementation might
 .\" want to check whether the input string contains any non-ASCII
 .\" characters.  If there are none the IDN step can be skipped completely.
 .\" On systems which allow not-ASCII safe encodings for a locale this
 .\" might be a problem.
-.TP
-.B AI_CANONIDN
-.\"O After a successful name lookup, and if the
-.\"O .B AI_CANONNAME
-.\"O flag was specified,
-.\"O .BR getaddrinfo ()
-.\"O will return the canonical name of the
-.\"O node corresponding to the
-.\"O .I addrinfo
-.\"O structure value passed back.
-.\"O The return value is an exact copy of the value returned by the name
-.\"O resolution function.
-.B AI_CANONNAME
-¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢
-.BR getaddrinfo ()
-¤Ï̾Á°¤Î¸¡º÷¤ËÀ®¸ù¤·¤¿¸å¡¢
-ÊÖ¤µ¤ì¤¿
-.I addrinfo
-¹½Â¤ÂΤËÂбþ¤¹¤ë¥Î¡¼¥É¤ÎÀµµ¬Ì¾¤òÊÖ¤¹¡£
-ÊÖ¤êÃͤÏ̾Á°²ò·èµ¡Ç½¤«¤éÊÖ¤µ¤ì¤¿ÃͤÎÀµ³Î¤Ê¥³¥Ô¡¼¤Ç¤¢¤ë¡£
+入力名に非 ASCII 文字が含まれている場合、 IDN 符号化形式が使われる。 非 ASCII
+文字が含まれている(ピリオドで区切られる)部分ノード名は、 名前解決機能に渡される前に ASCII 互換符号化形式 (ACE) を使って 符号化される。
+.TP 
+\fBAI_CANONIDN\fP
+\fBAI_CANONNAME\fP が指定されている場合、 \fBgetaddrinfo\fP()  は名前の検索に成功した後、 返された \fIaddrinfo\fP
+構造体に対応するノードの正規名を返す。 返り値は名前解決機能から返された値の正確なコピーである。
 
-.\"O If the name is encoded using ACE, then it will contain the
-.\"O .I xn\-\-
-.\"O prefix for one or more components of the name.
-.\"O To convert these components into a readable form the
-.B AI_CANONIDN
-.\"O flag can be passed in addition to
-.\"O .BR AI_CANONNAME .
-.\"O The resulting string is encoded using the current locale's encoding.
-̾Á°¤¬ ACE ¤ÇÉä¹æ²½¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢°ì¤Ä¤Þ¤¿¤ÏÊ£¿ô¤Î̾Á°¤Î¹½À®Í×ÁǤÎÀèƬ¤Ë
-.I xn\-\-
-¤ò´Þ¤ó¤Ç¤¤¤ë¡£
-¤³¤ì¤é¤Î¹½À®Í×ÁǤòÆɤ߹þ¤ß²Äǽ¤Ê·Á¤ËÊÑ´¹¤¹¤ë¤¿¤á¤Ë¡¢
-.B AI_CANONNAME
-¤È¶¦¤Ë
-.B AI_CANONIDN
-¥Õ¥é¥°¤òÅϤ¹¤³¤È¤â½ÐÍè¤ë¡£
-ÊÖ¤µ¤ì¤ëʸ»úÎó¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤ÎÉä¹æ²½·Á¼°¤ÇÉä¹æ²½¤µ¤ì¤Æ¤¤¤ë¡£
 .\"
 .\"Implementation Detail:
 .\"If no component of the returned name starts with xn\-\- the IDN
 .\"step can be skipped, therefore avoiding unnecessary slowdowns.
-.TP
-.BR AI_IDN_ALLOW_UNASSIGNED ", " AI_IDN_USE_STD3_ASCII_RULES
-.\"O Setting these flags will enable the
-.\"O IDNA_ALLOW_UNASSIGNED (allow unassigned Unicode code points) and
-.\"O IDNA_USE_STD3_ASCII_RULES (check output to make sure it is a STD3
-.\"O conforming hostname)
-.\"O flags respectively to be used in the IDNA handling.
-¤³¤ì¤é¤Î¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤ë¤È¡¢
-IDNA ¥Ï¥ó¥É¥ê¥ó¥°¤ò»È¤¦¤È¤­¤Ë¤½¤ì¤¾¤ì
-IDNA_ALLOW_UNASSIGNED (Èó³ä¤êÅö¤Æ Unicode ¥³¡¼¥É¥Ý¥¤¥ó¥È¤òµö²Ä¤¹¤ë) ¤È
-IDNA_USE_STD3_ASCII_RULES (½ÐÎϤ¬ STD3 ½àµò¥Û¥¹¥È̾¤Ç¤¢¤ë¤³¤È¤ò³Îǧ¤¹¤ë)
-¥Õ¥é¥°¤¬Í­¸ú¤Ë¤Ê¤ë¡£
-
-.\"O .SH "RETURN VALUE"
-.SH ÊÖ¤êÃÍ
+\fBAI_CANONIDN\fP 名前が ACE で符号化されている場合、一つまたは複数の名前の構成要素の先頭に \fIxn\-\-\fP を含んでいる。
+これらの構成要素を読み込み可能な形に変換するために、 \fBAI_CANONNAME\fP と共に \fBAI_CANONIDN\fP フラグを渡すことも出来る。
+返される文字列は現在のロケールの符号化形式で符号化されている。
+.TP 
+\fBAI_IDN_ALLOW_UNASSIGNED\fP, \fBAI_IDN_USE_STD3_ASCII_RULES\fP
+これらのフラグをセットすると、IDNA 処理で使用されるフラグ IDNA_ALLOW_UNASSIGNED (未割り当ての Unicode
+のコードポイントを許容) と IDNA_USE_STD3_ASCII_RULES (出力が STD3 準拠のホスト名かをチェックする)
+がそれぞれ有効になる。
+.SH 返り値
 .\" FIXME glibc defines the following additional errors, some which
 .\" can probably be returned by getaddrinfo(); they need to
 .\" be documented.
@@ -838,264 +257,82 @@ IDNA_USE_STD3_ASCII_RULES (
 .\" #define EAI_INTR        -104  /* Interrupted by a signal.  */
 .\" #define EAI_IDN_ENCODE  -105  /* IDN encoding failed.  */
 .\" #endif
-.\"O .BR getaddrinfo ()
-.\"O returns 0 if it succeeds, or one of the following nonzero error codes:
-.BR getaddrinfo ()
-¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤·¡¢¼ºÇÔ¤¹¤ë¤È°Ê²¼¤ÎÈó 0 ¤Î¥¨¥é¡¼¥³¡¼¥É¤Î¤¤¤º¤ì¤«¤òÊÖ¤¹¡£
-.TP
-.B EAI_ADDRFAMILY
+\fBgetaddrinfo\fP()  は成功すると 0 を返し、失敗すると以下の非 0 のエラーコードのいずれかを返す。
+.TP 
+\fBEAI_ADDRFAMILY\fP
 .\" Not in SUSv3
-.\"O The specified network host does not have any network addresses in the
-.\"O requested address family.
-»ØÄꤵ¤ì¤¿¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤Ë¤Ï¡¢
-Í׵ᤵ¤ì¤¿¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤¬¤Ê¤¤¡£
-.TP
-.B EAI_AGAIN
-.\"O The name server returned a temporary failure indication.
-.\"O Try again later.
-¥Í¡¼¥à¥µ¡¼¥Ð¡¼¤«¤é°ì»þŪ¤Ê¼ºÇÔ (temporary failure)
-¤ò°ÕÌ£¤¹¤ëÊÖ»ö¤¬ÊÖ¤µ¤ì¤¿¡£¸å¤Ç¤â¤¦°ìÅٻ¤Æ¤ß¤è¡£
-.TP
-.B EAI_BADFLAGS
-.\"O .I hints.ai_flags
-.\"O contains invalid flags; or,
-.\"O .I hints.ai_flags
-.\"O included
-.\"O .B AI_CANONNAME
-.\"O and
-.\"O .I name
-.\"O was NULL.
-.I hints.ai_flags
-¤Î¥Õ¥é¥°¤ËÉÔÀµ¤Ê¥Õ¥é¥°¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£¤Þ¤¿¤Ï¡¢
-.I hints.ai_flags
-¤Ë
-.B AI_CANONNAME
-¤¬´Þ¤Þ¤ì¤Æ¤¤¤Æ¡¢¤«¤Ä
-.I name
-¤¬ NULL ¤Ç¤¢¤Ã¤¿¡£
-.TP
-.B EAI_FAIL
-.\"O The name server returned a permanent failure indication.
-¥Í¡¼¥à¥µ¡¼¥Ð¡¼¤«¤é¹±µ×Ū¤Ê¼ºÇÔ (permanent failure)
-¤ò°ÕÌ£¤¹¤ëÊÖ»ö¤¬ÊÖ¤µ¤ì¤¿¡£
-.TP
-.B EAI_FAMILY
-.\"O The requested address family is not supported.
-Í׵ᤵ¤ì¤¿¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
-.TP
-.B EAI_MEMORY
-.\"O Out of memory.
-¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£
-.TP
-.B EAI_NODATA
+指定されたネットワークホストには、 要求されたアドレスファミリーのネットワークアドレスがない。
+.TP 
+\fBEAI_AGAIN\fP
+ネームサーバーから一時的な失敗 (temporary failure)  を意味する返事が返された。後でもう一度試してみよ。
+.TP 
+\fBEAI_BADFLAGS\fP
+\fIhints.ai_flags\fP のフラグに不正なフラグが含まれている。または、 \fIhints.ai_flags\fP に
+\fBAI_CANONNAME\fP が含まれていて、かつ \fIname\fP が NULL であった。
+.TP 
+\fBEAI_FAIL\fP
+ネームサーバーから恒久的な失敗 (permanent failure)  を意味する返事が返された。
+.TP 
+\fBEAI_FAMILY\fP
+要求されたアドレスファミリーがサポートされていない。
+.TP 
+\fBEAI_MEMORY\fP
+メモリが足りない。
+.TP 
+\fBEAI_NODATA\fP
 .\" Not in SUSv3
-.\"O The specified network host exists, but does not have any
-.\"O network addresses defined.
-»ØÄꤵ¤ì¤¿¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤Ï¸ºß¤¹¤ë¤¬¡¢
-¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤¬¤Ò¤È¤Ä¤âÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
-.TP
-.B EAI_NONAME
-.\"O The
-.\"O .I node
-.\"O or
-.\"O .I service
-.\"O is not known; or both
-.\"O .I node
-.\"O and
-.\"O .I service
-.\"O are NULL; or
-.\"O .B AI_NUMERICSERV
-.\"O was specified in
-.\"O .I hints.ai_flags
-.\"O and
-.\"O .I service
-.\"O was not a numeric port-number string.
-.I node
-¤È
-.I service
-¤Î¤É¤Á¤é¤«¤¬ÉÔÌÀ¡¢¤Þ¤¿¤Ï
-.I node
-¤È
-.I service
-¤ÎξÊý¤¬ NULL ¤À¤Ã¤¿¾ì¹ç¡¢¤Þ¤¿¤Ï
-.B AI_NUMERICSERV
-¤¬
-.I hints.ai_flags
-¤Ë»ØÄꤵ¤ì¤Æ¤¤¤Æ¡¢
-.I hints.ai_flags
-¤È
-.I service
-¤¬¿ôÃͤΥݡ¼¥ÈÈÖ¹æ¤Îʸ»úÎó¤Ç¤Ê¤¤¡£
-.TP
-.B EAI_SERVICE
-.\"O The requested service is not available for the requested socket type.
-.\"O It may be available through another socket type.
-Í׵ᤵ¤ì¤¿¥µ¡¼¥Ó¥¹¤Ï¡¢Í׵ᤵ¤ì¤¿¥½¥±¥Ã¥È¥¿¥¤¥×¤Ç¤ÏÍøÍѤǤ­¤Ê¤¤¡£
-¾¤Î¥½¥±¥Ã¥È¥¿¥¤¥×¤Ç¤Ê¤éÍøÍѲÄǽ¤«¤â¤·¤ì¤Ê¤¤¡£
-.\"O For example, this error could occur if
-.\"O .I service
-.\"O was "shell" (a service only available on stream sockets), and either
-.\"O .I hints.ai_protocol
-.\"O was
-.\"O .BR IPPROTO_UDP ,
-.\"O or
-.\"O .I hints.ai_socktype
-.\"O was
-.\"O .BR SOCK_DGRAM ;
-.\"O or the error could occur if
-.\"O .I service
-.\"O was not NULL, and
-.\"O .I hints.ai_socktype
-.\"O was
-.\"O .BR SOCK_RAW
-.\"O (a socket type that does not support the concept of services).
-¤³¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ëÎã¤È¤·¤Æ¤Ï¡¢
-.I service
-¤¬ "shell" (¥¹¥È¥ê¡¼¥à¡¦¥½¥±¥Ã¥È¤Ç¤Î¤ßÍøÍѤǤ­¤ë¥µ¡¼¥Ó¥¹) ¤Ç¡¢
-.I hints.ai_protocol
-¤Ë
-.B IPPROTO_UDP
-¤¬»ØÄꤵ¤ì¤¿¤ê¡¢
-.I hints.ai_socktype
-¤Ë
-.B SOCK_DGRAM
-¤¬»ØÄꤵ¤ì¤¿¤ê¤·¤¿¾ì¹ç¤¬¤¢¤ë¡£
-¤Þ¤¿¡¢
-.I service
-¤¬ NULL °Ê³°¤Ç¡¢
-.I hints.ai_socktype
-¤Ë
-.B SOCK_RAW
-(¥µ¡¼¥Ó¥¹¤Î¹Í¤¨Êý¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¥½¥±¥Ã¥È¼ïÊÌ)
-¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤â¡¢¤³¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¡£
-.TP
-.B EAI_SOCKTYPE
-.\"O The requested socket type is not supported.
-Í׵ᤵ¤ì¤¿¥½¥±¥Ã¥È¥¿¥¤¥×¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
-.\"O This could occur, for example, if
-.\"O .I hints.ai_socktype
-.\"O and
-.\"O .I hints.ai_protocol
-.\"O are inconsistent (e.g.,
-.\"O .BR SOCK_DGRAM
-.\"O and
-.\"O .BR IPPROTO_TCP ,
-.\"O respectively).
-¤³¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ëÎã¤È¤·¤Æ¤Ï¡¢
-.I hints.ai_socktype
-¤È
-.I hints.ai_protocol
-¤¬Ì·½â¤·¤Æ¤¤¤ë¾ì¹ç (Î㤨¤Ð
-.I hints.ai_socktype
-¤¬
-.B SOCK_DGRAM
-¤Ç
-.I hints.ai_protocol
-¤¬
-.BR IPPROTO_TCP )
-¤¬¤¢¤ë¡£
-.TP
-.B EAI_SYSTEM
-.\"O Other system error, check
-.\"O .I errno
-.\"O for details.
-¤½¤Î¾¤Î¥·¥¹¥Æ¥à¥¨¥é¡¼¡£¾Ü¤·¤¯¤Ï
-.I errno
-¤òÄ´¤Ù¤ë¤³¤È¡£
+指定されたネットワークホストは存在するが、 ネットワークアドレスがひとつも定義されていない。
+.TP 
+\fBEAI_NONAME\fP
+\fInode\fP と \fIservice\fP のどちらかが不明、または \fInode\fP と \fIservice\fP の両方が NULL だった場合、または
+\fBAI_NUMERICSERV\fP が \fIhints.ai_flags\fP に指定されていて、 \fIhints.ai_flags\fP と
+\fIservice\fP が数値のポート番号の文字列でない。
+.TP 
+\fBEAI_SERVICE\fP
+要求されたサービスは、要求されたソケットタイプでは利用できない。 他のソケットタイプでなら利用可能かもしれない。 このエラーが発生する例としては、
+\fIservice\fP が "shell" (ストリーム・ソケットでのみ利用できるサービス) で、 \fIhints.ai_protocol\fP に
+\fBIPPROTO_UDP\fP が指定されたり、 \fIhints.ai_socktype\fP に \fBSOCK_DGRAM\fP が指定されたりした場合がある。
+また、 \fIservice\fP が NULL 以外で、 \fIhints.ai_socktype\fP に \fBSOCK_RAW\fP
+(サービスの考え方をサポートしていないソケット種別)  が指定された場合にも、このエラーが発生する。
+.TP 
+\fBEAI_SOCKTYPE\fP
+要求されたソケットタイプがサポートされていない。 このエラーが発生する例としては、 \fIhints.ai_socktype\fP と
+\fIhints.ai_protocol\fP が矛盾している場合 (例えば \fIhints.ai_socktype\fP が \fBSOCK_DGRAM\fP で
+\fIhints.ai_protocol\fP が \fBIPPROTO_TCP\fP)  がある。
+.TP 
+\fBEAI_SYSTEM\fP
+その他のシステムエラー。詳しくは \fIerrno\fP を調べること。
 .PP
-.\"O The
-.\"O .BR gai_strerror ()
-.\"O function translates these error codes to a human readable string,
-.\"O suitable for error reporting.
-.BR gai_strerror ()
-´Ø¿ô¤òÍѤ¤¤ë¤È¡¢¤³¤ì¤é¤Î¥¨¥é¡¼¥³¡¼¥É¤ò¿Í´Ö¤Ë²ÄÆɤÊʸ»úÎó¤ËÊÑ´¹¤Ç¤­¤ë¤Î¤Ç¡¢
-¥¨¥é¡¼Êó¹ð¤ËŬ¤¹¤ë¤À¤í¤¦¡£
-.\"O .SH "FILES"
-.SH ¥Õ¥¡¥¤¥ë
-.I /etc/gai.conf
-.\"O .SH "CONFORMING TO"
-.SH ½àµò
-.\"O POSIX.1-2001.
-.\"O The
-.\"O .BR getaddrinfo ()
-.\"O function is documented in RFC\ 2553.
-POSIX.1-2001.
-.BR getaddrinfo ()
-´Ø¿ô¤Ï RFC 2553 ¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£
-.\"O .SH "NOTES"
-.SH Ãí°Õ
-.\"O .BR getaddrinfo ()
-.\"O supports the
-.\"O .IB address % scope-id
-.\"O notation for specifying the IPv6 scope-ID.
-.BR getaddrinfo ()
-¤Ï¡¢IPv6 scope-ID ¤ò»ØÄꤹ¤ë¤¿¤á¤Ë
-.IB address % scope-id
-µ­Ë¡¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£
-
-.\"O .BR AI_ADDRCONFIG ,
-.\"O .BR AI_ALL ,
-.\"O and
-.\"O .B AI_V4MAPPED
-.\"O are available since glibc 2.3.3.
-.\"O .B AI_NUMERICSERV
-.\"O is available since glibc 2.3.4.
-.BR AI_ADDRCONFIG ,
-.BR AI_ALL ,
-.B AI_V4MAPPED
-¤Ï glibc 2.3.3 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£
-.B AI_NUMERICSERV
-¤Ï glibc 2.3.4 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£
-
-.\"O According to POSIX.1-2001, specifying
-.\"O .I hints
-.\"O as NULL should cause
-.\"O .I ai_flags
-.\"O to be assumed as 0.
-.\"O The GNU C library instead assumes a value of
-.\"O .BR "(AI_V4MAPPED\ |\ AI_ADDRCONFIG)"
-.\"O for this case,
-.\"O since this value is considered an improvement on the specification.
-POSIX.1-2001 ¤Ë¤è¤ë¤È¡¢
-.I hints
-¤Ë NULL ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢
-.I ai_flags
-¤ò 0 ¤È¤ß¤Ê¤¹¤Ù¤­¤È¤µ¤ì¤Æ¤¤¤ë¡£
-GNU C ¥é¥¤¥Ö¥é¥ê¤Ç¤Ï¡¢¤³¤Î¾ì¹ç¤Ë¡¢Âå¤ï¤ê¤Ë
-.I ai_flags
-¤ò
-.BR "(AI_V4MAPPED\ |\ AI_ADDRCONFIG)"
-¤È¤ß¤Ê¤¹¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£
-¤³¤ÎÃͤÎÊý¤¬É¸½àµ¬³Ê¤Î²þÁ±¤Ë¤Ê¤ë¤È¹Í¤¨¤é¤ì¤Æ¤¤¤ë¤«¤é¤Ç¤¢¤ë¡£
-.\"O .SH EXAMPLE
-.SH Îã
+\fBgai_strerror\fP()  関数を用いると、これらのエラーコードを人間に可読な文字列に変換できるので、 エラー報告に適するだろう。
+.SH ファイル
+\fI/etc/gai.conf\fP
+.SH 準拠
+POSIX.1\-2001.  \fBgetaddrinfo\fP()  関数は RFC 2553 に記載されている。
+.SH 注意
+\fBgetaddrinfo\fP()  は、IPv6 scope\-ID を指定するために \fIaddress\fP\fB%\fP\fIscope\-id\fP
+記法をサポートしている。
+
+\fBAI_ADDRCONFIG\fP, \fBAI_ALL\fP, \fBAI_V4MAPPED\fP は glibc 2.3.3 以降で利用可能である。
+\fBAI_NUMERICSERV\fP は glibc 2.3.4 以降で利用可能である。
+
+POSIX.1\-2001 によると、 \fIhints\fP に NULL が指定された場合、 \fIai_flags\fP を 0 とみなすべきとされている。
+GNU C ライブラリでは、この場合に、代わりに \fIai_flags\fP を \fB(AI_V4MAPPED\ |\ AI_ADDRCONFIG)\fP
+とみなすようになっている。 この値の方が標準規格の改善になると考えられているからである。
+.SH 例
 .\" getnameinfo.3 refers to this example
 .\" socket.2 refers to this example
 .\" bind.2 refers to this example
 .\" connect.2 refers to this example
 .\" recvfrom.2 refers to this example
 .\" sendto.2 refers to this example
-.\"O The following programs demonstrate the use of
-.\"O .BR getaddrinfo (),
-.\"O .BR gai_strerror (),
-.\"O .BR freeaddrinfo (),
-.\"O and
-.\"O .BR getnameinfo (3).
-.\"O The programs are an echo server and client for UDP datagrams.
-°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¡¢
-.BR getaddrinfo (),
-.BR gai_strerror (),
-.BR freeaddrinfo (),
-.BR getnameinfo (3)
-¤Î»È¤¤Êý¤ò¼¨¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£
-¥×¥í¥°¥é¥à¤Ï UDP ¥Ç¡¼¥¿¥°¥é¥à¤Î echo ¥µ¡¼¥Ð¤È¥¯¥é¥¤¥¢¥ó¥È¤Ç¤¢¤ë¡£
-.\"O .SS Server program
-.SS ¥µ¡¼¥Ð¤Î¥×¥í¥°¥é¥à
+以下のプログラムは、 \fBgetaddrinfo\fP(), \fBgai_strerror\fP(), \fBfreeaddrinfo\fP(),
+\fBgetnameinfo\fP(3)  の使い方を示したものである。 プログラムは UDP データグラムの echo サーバとクライアントである。
+.SS サーバのプログラム
 \&
 .nf
 #include <sys/types.h>
 #include <stdio.h>
-#include <stdlib.h>  
+#include <stdlib.h> 
 #include <unistd.h>
 #include <string.h>
 #include <sys/socket.h>
@@ -1115,7 +352,7 @@ main(int argc, char *argv[])
     char buf[BUF_SIZE];
 
     if (argc != 2) {
-        fprintf(stderr, "Usage: %s port\\n", argv[0]);
+        fprintf(stderr, "Usage: %s port\en", argv[0]);
         exit(EXIT_FAILURE);
     }
 
@@ -1130,7 +367,7 @@ main(int argc, char *argv[])
 
     s = getaddrinfo(NULL, argv[1], &hints, &result);
     if (s != 0) {
-        fprintf(stderr, "getaddrinfo: %s\\n", gai_strerror(s));
+        fprintf(stderr, "getaddrinfo: %s\en", gai_strerror(s));
         exit(EXIT_FAILURE);
     }
 
@@ -1140,7 +377,7 @@ main(int argc, char *argv[])
        and) try the next address. */
 
     for (rp = result; rp != NULL; rp = rp\->ai_next) {
-        sfd = socket(rp\->ai_family, rp\->ai_socktype, 
+        sfd = socket(rp\->ai_family, rp\->ai_socktype,
                 rp\->ai_protocol);
         if (sfd == \-1)
             continue;
@@ -1152,7 +389,7 @@ main(int argc, char *argv[])
     }
 
     if (rp == NULL) {               /* No address succeeded */
-        fprintf(stderr, "Could not bind\\n");
+        fprintf(stderr, "Could not bind\en");
         exit(EXIT_FAILURE);
     }
 
@@ -1173,20 +410,19 @@ main(int argc, char *argv[])
                         peer_addr_len, host, NI_MAXHOST,
                         service, NI_MAXSERV, NI_NUMERICSERV);
        if (s == 0)
-            printf("Received %ld bytes from %s:%s\\n",
-                    (long) nread, host, service);
+            printf("Received %zd bytes from %s:%s\en",
+                    nread, host, service);
         else
-            fprintf(stderr, "getnameinfo: %s\\n", gai_strerror(s));
+            fprintf(stderr, "getnameinfo: %s\en", gai_strerror(s));
 
         if (sendto(sfd, buf, nread, 0,
                     (struct sockaddr *) &peer_addr,
                     peer_addr_len) != nread)
-            fprintf(stderr, "Error sending response\\n");
+            fprintf(stderr, "Error sending response\en");
     }
 }
 .fi
-.\"O .SS Client program
-.SS ¥¯¥é¥¤¥¢¥ó¥È¤Î¥×¥í¥°¥é¥à
+.SS クライアントのプログラム
 \&
 .nf
 #include <sys/types.h>
@@ -1210,7 +446,7 @@ main(int argc, char *argv[])
     char buf[BUF_SIZE];
 
     if (argc < 3) {
-        fprintf(stderr, "Usage: %s host port msg...\\n", argv[0]);
+        fprintf(stderr, "Usage: %s host port msg...\en", argv[0]);
         exit(EXIT_FAILURE);
     }
 
@@ -1224,7 +460,7 @@ main(int argc, char *argv[])
 
     s = getaddrinfo(argv[1], argv[2], &hints, &result);
     if (s != 0) {
-        fprintf(stderr, "getaddrinfo: %s\\n", gai_strerror(s));
+        fprintf(stderr, "getaddrinfo: %s\en", gai_strerror(s));
         exit(EXIT_FAILURE);
     }
 
@@ -1246,13 +482,13 @@ main(int argc, char *argv[])
     }
 
     if (rp == NULL) {               /* No address succeeded */
-        fprintf(stderr, "Could not connect\\n");
+        fprintf(stderr, "Could not connect\en");
         exit(EXIT_FAILURE);
     }
 
     freeaddrinfo(result);           /* No longer needed */
 
-    /* Send remaining command\-line arguments as separate 
+    /* Send remaining command\-line arguments as separate
        datagrams, and read responses from server */
 
     for (j = 3; j < argc; j++) {
@@ -1261,12 +497,12 @@ main(int argc, char *argv[])
 
         if (len + 1 > BUF_SIZE) {
             fprintf(stderr,
-                    "Ignoring long message in argument %d\\n", j);
+                    "Ignoring long message in argument %d\en", j);
             continue;
         }
 
         if (write(sfd, argv[j], len) != len) {
-            fprintf(stderr, "partial/failed write\\n");
+            fprintf(stderr, "partial/failed write\en");
             exit(EXIT_FAILURE);
         }
 
@@ -1276,18 +512,18 @@ main(int argc, char *argv[])
             exit(EXIT_FAILURE);
         }
 
-        printf("Received %ld bytes: %s\\n", (long) nread, buf);
+        printf("Received %zd bytes: %s\en", nread, buf);
     }
 
     exit(EXIT_SUCCESS);
 }
 .fi
-.\"O .SH "SEE ALSO"
-.SH ´ØÏ¢¹àÌÜ
+.SH 関連項目
 .\" .BR getipnodebyaddr (3),
-.\" .BR getipnodebyname (3)
-.BR gethostbyname (3),
-.BR getnameinfo (3),
-.BR inet (3),
-.BR hostname (7),
-.BR ip (7)
+.\" .BR getipnodebyname (3),
+\fBgetaddrinfo_a\fP(3), \fBgethostbyname\fP(3), \fBgetnameinfo\fP(3), \fBinet\fP(3),
+\fBgai.conf\fP(5), \fBhostname\fP(7), \fBip\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.64 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。