OSDN Git Service

(split) Fixed #25191 (typo in fenv.3).
[linuxjm/LDP_man-pages.git] / release / man3 / gethostbyname.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" References consulted:
24 .\"     Linux libc source code
25 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
26 .\"     386BSD man pages
27 .\" Modified 1993-05-22, David Metcalfe
28 .\" Modified 1993-07-25, Rik Faith (faith@cs.unc.edu)
29 .\" Modified 1997-02-16, Andries Brouwer (aeb@cwi.nl)
30 .\" Modified 1998-12-21, Andries Brouwer (aeb@cwi.nl)
31 .\" Modified 2000-08-12, Andries Brouwer (aeb@cwi.nl)
32 .\" Modified 2001-05-19, Andries Brouwer (aeb@cwi.nl)
33 .\" Modified 2002-08-05, Michael Kerrisk
34 .\" Modified 2004-10-31, Andries Brouwer
35 .\"
36 .\" Japanese Version Copyright (c) 1998-2000 NAKANO Takeo all rights reserved.
37 .\" Translated 1998-04-30, NAKANO Takeo <nakano@apm.seikei.ac.jp>
38 .\" Modified 1998-12-06, NAKANO Takeo
39 .\" Updated & Modified 1999-10-12, NAKANO Takeo
40 .\" Updated & Modified 2001-07-01, Yuichi SATO <ysato@h4.dion.ne.jp>
41 .\" Updated & Modified 2002-01-03, Yuichi SATO
42 .\" Updated & Modified 2003-11-27, Yuichi SATO <ysato444@yahoo.co.jp>
43 .\" Updated & Modified 2005-01-10, Yuichi SATO
44 .\" Updated 2006-01-18, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
45 .\" Updated 2007-06-11, Akihiro MOTOKI, LDP v2.54
46 .\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05
47 .\"
48 .TH GETHOSTBYNAME 3 2010-10-04 "" "Linux Programmer's Manual"
49 .SH Ì¾Á°
50 gethostbyname, gethostbyaddr, sethostent, gethostent, endhostent,
51 h_errno,
52 herror, hstrerror,
53 gethostbyaddr_r,
54 gethostbyname2, gethostbyname2_r, gethostbyname_r,
55 gethostent_r \- ¥Í¥Ã¥È¥ï¡¼¥¯¾å¤Î¥Û¥¹¥È¤Î¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë
56 .SH ½ñ¼°
57 .nf
58 .B #include <netdb.h>
59 .B extern int h_errno;
60 .sp
61 .BI "struct hostent *gethostbyname(const char *" name );
62 .sp
63 .BR "#include <sys/socket.h>" "       /* AF_INET ¤ò»È¤¦¾ì¹ç */"
64 .BI "struct hostent *gethostbyaddr(const void *" addr ,
65 .BI "                              socklen_t " len ", int " type );
66 .sp
67 .BI "void sethostent(int " stayopen );
68 .sp
69 .B void endhostent(void);
70 .sp
71 .BI "void herror(const char *" s );
72 .sp
73 .BI "const char *hstrerror(int " err );
74 .sp
75 /* System V/POSIX ³ÈÄ¥ */
76 .br
77 .B struct hostent *gethostent(void);
78 .sp
79 /* GNU ³ÈÄ¥ */
80 .br
81 .BI "struct hostent *gethostbyname2(const char *" name ", int " af );
82 .sp
83 .B "int gethostent_r("
84 .BI "        struct hostent *" ret ", char *" buf ", size_t " buflen ,
85 .BI "        struct hostent **" result ", int *" h_errnop );
86 .sp
87 .BI "int gethostbyaddr_r(const void *" addr ", socklen_t " len ", int " type ,
88 .BI "        struct hostent *" ret ", char *" buf ", size_t " buflen ,
89 .BI "        struct hostent **" result ", int *" h_errnop );
90 .sp
91 .BI "int gethostbyname_r(const char *" name ,
92 .BI "        struct hostent *" ret ", char *" buf ", size_t " buflen ,
93 .BI "        struct hostent **" result ", int *" h_errnop );
94 .sp
95 .BI "int gethostbyname2_r(const char *" name ", int " af,
96 .BI "        struct hostent *" ret ", char *" buf ", size_t " buflen ,
97 .BI "        struct hostent **" result ", int *" h_errnop );
98 .fi
99 .sp
100 .in -4n
101 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
102 .RB ( feature_test_macros (7)
103 »²¾È):
104 .in
105 .sp
106 .PD 0
107 .ad l
108 .BR gethostbyname2 (),
109 .BR gethostent_r (),
110 .BR gethostbyaddr_r (),
111 .BR gethostbyname_r (),
112 .BR gethostbyname2_r ():
113 .RS 4
114 _BSD_SOURCE || _SVID_SOURCE
115 .RE
116
117 .BR herror (),
118 .BR hstrerror ():
119 .RS 4
120 .TP 4
121 glibc 2.8 °Ê¹ß:
122 _BSD_SOURCE || _SVID_SOURCE || _GNU_SOURCE
123 .TP
124 glibc 2.8 ¤è¤êÁ°:
125 ¤Ê¤·
126 .RE
127 .ad b
128 .PD
129 .SH ÀâÌÀ
130 .BR gethostbyname* ()
131 ¤È
132 .BR gethostbyaddr* ()
133 ¤Ï²áµî¤Î¤â¤Î¤Ç¤¢¤ë¡£
134 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢Âå¤ï¤ê¤Ë
135 .BR getaddrinfo (3)
136 ¤È
137 .BR getnameinfo (3)
138 ¤ò»ÈÍѤ¹¤ë¤³¤È¡£
139
140 .BR gethostbyname ()
141 ´Ø¿ô¤ÏÍ¿¤¨¤é¤ì¤¿¥Û¥¹¥È̾
142 .I name
143 ¤ËÂбþ¤¹¤ë¹½Â¤ÂÎ
144 .I hostent
145 ¤òÊÖ¤¹¡£
146 .I name
147 ¤Ë¤Ï¥Û¥¹¥È̾¡¢¥É¥Ã¥È¶èÀÚ¤ê¤Î IPv4 ¥¢¥É¥ì¥¹
148 .RB ( inet_addr (3)
149 »²¾È)¡¢¥³¥í¥ó¶èÀÚ¤ê¤Î IPv6 ¥¢¥É¥ì¥¹ (¤ª¤½¤é¤¯¥É¥Ã¥È¶èÀÚ¤ê¤Ç¤âÂç¾æÉ×)
150 ¤Î¤¤¤º¤ì¤«¤ò»ØÄꤹ¤ë
151 (IPv6 ¥¢¥É¥ì¥¹¤Îµ­½ÒÊýË¡¤Ë¤Ä¤¤¤Æ¤Ï RFC\ 1884 ¤ò»²¹Í¤Ë¤·¤Æ¤Û¤·¤¤)¡£
152 .I name
153 ¤¬ IPv4 ¤« IPv6 ¤Î¥¢¥É¥ì¥¹¤À¤Ã¤¿¾ì¹ç¡¢
154 ̾Á°²ò·è (lookup) ¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£¤½¤Î¾ì¹ç¤Ë¤Ï¡¢
155 .BR gethostbyname ()
156 ¤Ï
157 .I name
158 ¤ò¤½¤Î¤Þ¤Þ
159 .I hostent
160 ¹½Â¤ÂΤÎ
161 .I h_name
162 ¥Õ¥£¡¼¥ë¥É¤Ë¥³¥Ô¡¼¤·¡¢
163 ¤µ¤é¤Ë
164 .I name
165 ¤ò
166 .I struct in_addr
167 ·Á¼°¤Çɽ¤·¤¿¥Ç¡¼¥¿¤ò
168 .I hostent
169 ¹½Â¤ÂΤÎ
170 .I h_addr_list[0]
171 ¥Õ¥£¡¼¥ë¥É¤ËÆþ¤ì¤Æ¡¢¤½¤Î
172 .I hostent
173 ¹½Â¤ÂΤòÊÖ¤¹¡£
174 .I name
175 ¤¬¥É¥Ã¥È¤Ç½ªÎ»¤·¤Æ¤¤¤Æ¡¢¤«¤Ä´Ä¶­ÊÑ¿ô
176 .B HOSTALIASES
177 ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¤Þ¤º
178 .B HOSTALIASES
179 ¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥¨¥¤¥ê¥¢¥¹¥Õ¥¡¥¤¥ë¤«¤é
180 .I name
181 ¤Î¥¨¥ó¥È¥ê¤¬¸¡º÷¤µ¤ì¤ë (¥Õ¥¡¥¤¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë¤Ä¤¤¤Æ¤Ï
182 .BR hostname (7)
183 ¤ò»²¾È¤Î¤³¤È)¡£
184 .I name
185 ¤¬¥É¥Ã¥È¤Ç½ªÎ»¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢¸½ºß¤Î¥É¥á¥¤¥ó¤È¤½¤Î¿Æ¥É¥á¥¤¥ó¤¬¸¡º÷¤µ¤ì¤ë¡£
186 .PP
187 .BR gethostbyaddr ()
188 ´Ø¿ô¤ÏÍ¿¤¨¤é¤ì¤¿¥Û¥¹¥È¥¢¥É¥ì¥¹
189 .I addr
190 (Ťµ \fIlen\fP¡¢ ¥¿¥¤¥× \fItype\fP) ¤ËÂбþ¤¹¤ë¹½Â¤ÂÎ
191 .I hostent
192 ¤òÊÖ¤¹¡£
193 ÍѤ¤¤ë¤³¤È¤Î¤Ç¤­¤ë¥¿¥¤¥×¤Ï
194 .B AF_INET
195 ¤È
196 .B AF_INET6
197 ¤Ç¤¢¤ë¡£
198 ¥Û¥¹¥È¥¢¥É¥ì¥¹°ú¤­¿ô¤Ï¥¢¥É¥ì¥¹¥¿¥¤¥×¤Ë°Í¸¤·¤¿
199 ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£
200 Î㤨¤Ð¡¢¥¢¥É¥ì¥¹¥¿¥¤¥×
201 .B AF_INET
202 ¤ËÂФ·¤Æ¤Ï
203 .RB ( inet_addr (3)
204 ¤Î¸Æ¤Ó½Ð¤·¤ÇÆÀ¤é¤ì¤ë)
205 \fIstruct in_addr *\fP ¤Ç¤¢¤ë¡£
206 .PP
207 .BR sethostent ()
208 ´Ø¿ô¤Ï¡¢¥Í¡¼¥à¥µ¡¼¥Ð¤Ø¤ÎÀܳ·ÁÂÖ¤ò»ØÄꤹ¤ë¡£
209 .I stayopen
210 ¤¬¿¿ (1) ¤Ê¤é¤Ð¡¢¥Í¡¼¥à¥µ¡¼¥Ð¤Ø¤ÎÌ䤤¹ç¤ï¤»¤Ë¤Ï¡¢
211 Àܳ¤µ¤ì¤¿ TCP ¥½¥±¥Ã¥È¤òÍѤ¤¡¢Ï¢Â³¤·¤¿Ì䤤¹ç¤ï¤»¤Î´Ö¤ËÀܳ¤ò°Ý»ý¤¹¤ë¡£
212 µ¶¤Ê¤é¤Ð¥Í¡¼¥à¥µ¡¼¥Ð¤Ø¤ÎÌ䤤¹ç¤ï¤»¤Ë UDP ¥Ç¡¼¥¿¥°¥é¥à¤òÍѤ¤¤ë¡£
213 .PP
214 .BR endhostent ()
215 ´Ø¿ô¤Ï¥Í¡¼¥à¥µ¡¼¥Ð¤Ø¤ÎÌ䤤¹ç¤ï¤»¤ËÍѤ¤¤¿ TCP Àܳ¤ÎÍøÍѤò½ªÎ»¤¹¤ë¡£
216 .PP
217 (ÇÑ»ßͽÄê¤Î)
218 .BR herror ()
219 ´Ø¿ô¤Ï¸½ºß¤Î
220 .I h_errno
221 ¤ËÂбþ¤¹¤ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɸ½à¥¨¥é¡¼ \fIstderr\fP ¤Ë½ÐÎϤ¹¤ë¡£
222 .PP
223 (ÇÑ»ßͽÄê¤Î)
224 .BR hstrerror ()
225 ´Ø¿ô¤Ï¥¨¥é¡¼ÈÖ¹æ (Ä̾ï¤Ï \fIh_errno\fP) ¤ò°ú¤­¿ô¤Ë¼è¤ê¡¢
226 Âбþ¤¹¤ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸Ê¸»úÎó¤òÊÖ¤¹¡£
227 .PP
228 .BR gethostbyname ()
229 ¤È
230 .BR gethostbyaddr ()
231 ¤Ë¤è¤Ã¤Æ¼Â¹Ô¤µ¤ì¤ë¥É¥á¥¤¥ó̾¤ÎÌ䤤¹ç¤ï¤»¤Ç¤Ï¡¢¥Í¡¼¥à¥µ¡¼¥Ð
232 .BR named (8)¡¢
233 .I /etc/hosts
234 ¤Î¥Ç¡¼¥¿¹Ô¡¢¤ª¤è¤Ó
235 Network Information Service (NIS ¤Þ¤¿¤Ï YP)
236 ¤¬ÁȤ߹ç¤ï¤»¤Æ»ÈÍѤµ¤ì¤ë¡£²¿¤¬»ÈÍѤµ¤ì¤ë¤«¤Ï¡¢
237 .I /etc/host.conf
238 ¤Î
239 .I order
240 ¹Ô¤ÎÆâÍƤˤè¤ê·è¤Þ¤ë¡£
241 .\" (¾Ü¤·¤¯¤Ï
242 .\" .BR resolv+ (8)
243 .\" ¤ò»²¾È)¡£
244 ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¤Þ¤º
245 .BR named (8)
246 ¤ËÌ䤤¹ç¤ï¤»¤ò¹Ô¤¤¡¢¼¡¤¤¤Ç
247 .I /etc/hosts
248 ¤ò»²¾È¤¹¤ë¡£
249 .PP
250 .I hostent
251 ¹½Â¤ÂΤÏ
252 .I <netdb.h>
253 ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë:
254 .sp
255 .in +4n
256 .nf
257 .ne 7
258 struct hostent {
259     char  *h_name;            /* official name of host */
260     char **h_aliases;         /* alias list */
261     int    h_addrtype;        /* host address type */
262     int    h_length;          /* length of address */
263     char **h_addr_list;       /* list of addresses */
264 }
265 #define h_addr h_addr_list[0] /* ²áµî¤È¤Î¸ß´¹À­¤Î¤¿¤á */
266 .fi
267 .in
268 .PP
269 .I hostent
270 ¹½Â¤ÂΤΥá¥ó¥Ð¤Ï°Ê²¼¤ÎÄ̤ꡣ
271 .TP
272 .I h_name
273 ¥Û¥¹¥È¤ÎÀµ¼°Ì¾ (official name)¡£
274 .TP
275 .I h_aliases
276 ¥Û¥¹¥È¤ÎÊÌ̾¤ÎÇÛÎó¡£ÇÛÎó¤Ï NULL ¥Ý¥¤¥ó¥¿¤Ç½ªÃ¼¤µ¤ì¤ë¡£
277 .TP
278 .I h_addrtype
279 ¥¢¥É¥ì¥¹¤Î¥¿¥¤¥×¡£¸½ºß¤Ï¤¹¤Ù¤Æ
280 .B AF_INET
281 ¤Þ¤¿¤Ï
282 .B AF_INET6
283 ¤Ç¤¢¤ë¡£
284 .TP
285 .I h_length
286 ¥Ð¥¤¥Èñ°Ì¤Çɽ¤·¤¿¥¢¥É¥ì¥¹¤ÎŤµ¡£
287 .TP
288 .I h_addr_list
289 ¥Û¥¹¥È¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤Ø¤Î¥Ý¥¤¥ó¥¿¤ÎÇÛÎó¡£
290 ÇÛÎó¤Ï NULL ¥Ý¥¤¥ó¥¿¤Ç½ªÃ¼¤µ¤ì¤ë¡£
291 ¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À·Á¼°¤Ç¤¢¤ë¡£
292 .TP
293 .I h_addr
294 .I h_addr_list
295 ¤ÎºÇ½é¤Î¥¢¥É¥ì¥¹¡£²áµî¤È¤Î¸ß´¹À­¤òÊݤĤ¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£
296 .SH ÊÖ¤êÃÍ
297 .BR gethostbyname ()
298 ¤ª¤è¤Ó
299 .BR gethostbyaddr ()
300 ´Ø¿ô¤Ï
301 .I hostent
302 ¹½Â¤ÂΤòÊÖ¤¹¡£¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¤é NULL ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£¥¨¥é¡¼¤ÎºÝ¤Ë¤Ï
303 .I h_errno
304 ÊÑ¿ô¤¬¥¨¥é¡¼¤ÎÈÖ¹æ¤òÊÝ»ý¤¹¤ë¡£
305 ÊÖ¤êÃͤ¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ÀÅŪ¥Ç¡¼¥¿¤ò¥Ý¥¤¥ó¥¿¤Ç»Ø¤·¤Æ¤¤¤ë¤³¤È¤â¤¢¤ë¡£
306 °Ê²¼¤Î¡ÖÃí°Õ¡×¤ò»²¾È¤¹¤ë¤³¤È¡£
307 .SH ¥¨¥é¡¼
308 .I h_errno
309 ÊÑ¿ô¤Ï°Ê²¼¤ÎÃͤò¼è¤ê¤¦¤ë¡£
310 .TP
311 .B HOST_NOT_FOUND
312 »ØÄꤷ¤¿¥Û¥¹¥È¤¬¸«¤Ä¤«¤é¤Ê¤¤¡£
313 .TP
314 .B NO_ADDRESS " ¤Þ¤¿¤Ï " NO_DATA
315 »ØÄꤷ¤¿Ì¾Á°¤ÏÍ­¸ú¤À¤¬ IP ¥¢¥É¥ì¥¹¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£
316 .TP
317 .B NO_RECOVERY
318 ¥Í¡¼¥à¥µ¡¼¥Ð¤ÎÉüµìÉÔǽ¤Ê¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£
319 .TP
320 .B TRY_AGAIN
321 authoritative ¤Ê¥Í¡¼¥à¥µ¡¼¥Ð¤Ç°ì»þŪ¤Ê¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£
322 »þ´Ö¤ò¤ª¤¤¤Æ¤â¤¦°ìÅٻ¤³¤È¡£
323 .SH ¥Õ¥¡¥¤¥ë
324 .TP
325 .I /etc/host.conf
326 ̾Á°²ò·è¤ÎÀßÄê¥Õ¥¡¥¤¥ë
327 .TP
328 .I /etc/hosts
329 ¥Û¥¹¥È¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë
330 .TP
331 .I /etc/nsswitch.conf
332 ¥Í¡¼¥à¥µ¡¼¥Ó¥¹ÀÚÂØÀßÄê
333 .SH ½àµò
334 POSIX.1-2001 ¤Ç¤Ï¡¢
335 .BR gethostbyname (),
336 .BR gethostbyaddr (),
337 .BR sethostent (),
338 .BR endhostent (),
339 .BR gethostent (),
340 .I h_errno
341 ¤¬µ¬Äꤵ¤ì¤Æ¤ª¤ê¡¢
342 .BR gethostbyaddr ()
343 ¤È
344 .BR gethostbyname ()
345 ¤ÏÇÑ»ßͽÄê¤Ç¤¢¤ë¤È¤µ¤ì¤Æ¤¤¤ë¡£
346 POSIX.1-2008 ¤Ç¤Ï
347 .BR gethostbyname (),
348 .BR gethostbyaddr (),
349 .I h_errno
350 ¤Î»ÅÍͤ¬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£
351 Âå¤ï¤ê¤Ë¡¢
352 .BR getaddrinfo (3)
353 ¤È
354 .BR getnameinfo (3)
355 ¤Î»ÈÍѤ¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£
356 .SH Ãí°Õ
357 .BR gethostbyname ()
358 ¤ª¤è¤Ó
359 .BR gethostbyaddr ()
360 ´Ø¿ô¤ÏÀÅŪ¥Ç¡¼¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
361 ¤³¤Î¥Ý¥¤¥ó¥¿¤Ï¡¢¤½¤Î¸å¤Î¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
362 .I hostent
363 ¹½Â¤ÂΤϥݥ¤¥ó¥¿¤ò´Þ¤ó¤Ç¤¤¤ë¤Î¤Ç¡¢¹½Â¤ÂΤΥ³¥Ô¡¼¤À¤±¤Ç¤ÏÉÔ½½Ê¬¤Ç¤¢¤ë;
364 ¤è¤ê¿¼¤¤¥³¥Ô¡¼¤¬É¬ÍפǤ¢¤ë¡£
365 .LP
366 ¥ª¥ê¥¸¥Ê¥ë¤Î BSD ¤Î¼ÂÁõ¤Ç¤Ï¡¢
367 .BR gethostbyname ()
368 ¤Î
369 .I len
370 °ú¤­¿ô¤Ï
371 .I int
372 ¤Ç¤¢¤Ã¤¿¡£
373 SUSv2 É¸½à¤Ï¥Ð¥°¤¬Â¿¤¯¡¢
374 .BR gethostbyaddr ()
375 ¤Î
376 .I len
377 ¥Ñ¥é¥á¡¼¥¿¤ò
378 .I size_t
379 ·¿¤È¤·¤ÆÀë¸À¤·¤Æ¤¤¤ë¡£
380 (¤³¤ì¤Ï¸í¤ê¤Ç¡¢
381 .I size_t
382 ·¿¤Ç¤Ï¤Ê¤¯
383 .I int
384 ·¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
385 POSIX.1-2001 ¤Ç¤Ï¤³¤ì¤ò
386 .I socklen_t
387 ¤È¤·¤Æ¤¤¤ë¤¬¡¢¤³¤ì¤Ï OK¡£)
388 .BR accept (2)
389 ¤â»²¾È¡£
390 .LP
391 .BR gethostbyaddr ()
392 ¤Î BSD ¤Î¥×¥í¥È¥¿¥¤¥×¤Ï¡¢ºÇ½é¤Î°ú¤­¿ô¤È¤·¤Æ
393 .I const char *
394 ¤ò»È¤¦¡£
395 .SS "System V/POSIX ³ÈÄ¥"
396 POSIX ¤Ç¤Ï¡¢
397 .BR gethostent ()
398 ¤¬É¬¿Ü¤È¤µ¤ì¤Æ¤¤¤ë¡£
399 ¤³¤Î´Ø¿ô¤Ï¥Û¥¹¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¼¡¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹¡£
400 DNS/BIND ¤ò»È¤¦¾ì¹ç¤Ï¤¢¤Þ¤ê°ÕÌ£¤ò»ý¤¿¤Ê¤¤¤¬¡¢
401 ¥Û¥¹¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬ 1 ¹Ô¤º¤ÄÆɤ߹þ¤Þ¤ì¤ë¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¾ì¹ç¤Ï°ÕÌ£¤¬¤¢¤ë¡£
402 ¿¤¯¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤³¤Î̾Á°¤Î¥ë¡¼¥Á¥ó¤Ï¥Õ¥¡¥¤¥ë
403 .I /etc/hosts
404 ¤òÆɤ߹þ¤à¡£
405 .\" Î㤨¤Ð¡¢Linux, FreeBSD, UnixWare, HP-UX
406 DNS ¥µ¥Ý¡¼¥È¤Ê¤·¤Ç¥é¥¤¥Ö¥é¥ê¤¬¥Ó¥ë¥É¤µ¤ì¤¿¾ì¹ç¤Ë¤Î¤ßÍøÍѲÄǽ¤Ç¤¢¤ë¡£
407 .\" Î㤨¤Ð¡¢FreeBSD, AIX
408 glibc ÈǤϠipv6 ¥¨¥ó¥È¥ê¤ò̵»ë¤¹¤ë¡£
409 ¤³¤Î´Ø¿ô¤Ï¥ê¥¨¥ó¥È¥é¥ó¥È (reentrant) ¤Ç¤Ï¤Ê¤¯¡¢
410 glibc ¤Ë¤Ï¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤÎ
411 .BR gethostent_r ()
412 ¤¬Äɲ䵤줿¡£
413 .SS "GNU ³ÈÄ¥"
414 glibc2 ¤Ë¤Ï
415 .BR gethostbyname2 ()
416 ¤â¤¢¤ê¡¢
417 .BR gethostbyname ()
418 ¤ÈƱ¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¤¬¡¢
419 ¤³¤Á¤é¤Ï¥¢¥É¥ì¥¹¤¬Â°¤¹¤ë¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
420 .LP
421 glibc2 ¤Ë¤Ï¥ê¥¨¥ó¥È¥é¥ó¥È¤Ê
422 .BR gethostent_r (),
423 .BR gethostbyaddr_r (),
424 .BR gethostbyname_r ()
425 ¤È
426 .BR gethostbyname2_r ()
427 ¤â¤¢¤ë¡£
428 ¸Æ¤Ó½Ð¤·Â¦¤Ï¡¢À®¸ù»þ¤Ë·ë²Ì¤¬³ÊǼ¤µ¤ì¤ë
429 .I hostent
430 ¹½Â¤ÂÎ
431 .I ret
432 ¤È¡¢Â礭¤µ
433 .I buflen
434 ¤Î°ì»þŪ¤Êºî¶È¥Ð¥Ã¥Õ¥¡
435 .I buf
436 ¤òÄ󶡤¹¤ë¡£
437 ¥³¡¼¥ë½ªÎ»¸å¡¢À®¸ù¤·¤¿¾ì¹ç
438 .I result
439 ¤Ï·ë²Ì¤ò»Ø¤·¤Æ¤¤¤ë¡£
440 ¥¨¥é¡¼¤Î¾ì¹ç¡¢¤Þ¤¿¤Ï¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¡¢
441 .I result
442 ¤Ï NULL ¤Ë¤Ê¤ë¡£
443 ¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç 0 ¤òÊÖ¤·¡¢¼ºÇԤξì¹ç¤Ï 0 °Ê³°¤Î¥¨¥é¡¼ÈÖ¹æ¤òÊÖ¤¹¡£
444 ¤³¤ì¤é¤Î´Ø¿ô¤Î¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤Ê¤¤¥Ð¡¼¥¸¥ç¥ó¤¬ÊÖ¤¹¥¨¥é¡¼¤Ë²Ã¤¨¤Æ¡¢
445 ¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢
446 .I buf
447 ¤¬¾®¤µ¤¹¤®¤¿¾ì¹ç¤Ë
448 .B ERANGE
449 ¤òÊÖ¤¹¡£¤³¤Î¾ì¹ç¤Ï¤â¤Ã¤ÈÂ礭¤Ê¥Ð¥Ã¥Õ¥¡¤òÍÑ°Õ¤·¤Æ
450 ´Ø¿ô¸Æ¤Ó½Ð¤·¤òºÆÅÙ¹Ô¤¦¤Ù¤­¤Ç¤¢¤ë¡£
451 Âç°èÊÑ¿ô
452 .I h_errno
453 ¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¤¬¡¢¥¨¥é¡¼ÈÖ¹æ¤ò³ÊǼ¤¹¤ëÊÑ¿ô¤Î¥¢¥É¥ì¥¹¤¬
454 .I h_errnop
455 ¤ËÅϤµ¤ì¤ë¡£
456 .SH ¥Ð¥°
457 .BR gethostbyname ()
458 ¤Ï¡¢16¿Ê¿ôɽ¸½¤Î¥É¥Ã¥È¶èÀÚ¤ê¤Î IPv4 ¥¢¥É¥ì¥¹Ê¸»úÎó¤ÎÍ×ÁǤòǧ¼±¤·¤Ê¤¤¡£
459 .\" http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=482973
460 .SH ´ØÏ¢¹àÌÜ
461 .BR getaddrinfo (3),
462 .\" .BR getipnodebyaddr (3),
463 .\" .BR getipnodebyname (3),
464 .BR getnameinfo (3),
465 .BR inet (3),
466 .BR inet_ntop (3),
467 .BR inet_pton (3),
468 .BR resolver (3),
469 .BR hosts (5),
470 .BR nsswitch.conf (5),
471 .BR hostname (7),
472 .BR named (8)
473 .\" .BR resolv+ (8)