Debian Codegraph @

po/pt_BR/man3/getaddrinfo.3.po

raw
1 # Brazilian Portuguese translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Rubens de Jesus Nogueira <[email protected]>, 2000.
5 # André Luiz Fassone <[email protected]>, 2000.
6 msgid ""
7 msgstr ""
8 "Project-Id-Version: manpages-l10n\n"
9 "POT-Creation-Date: 2026-06-05 06:25+0200\n"
10 "PO-Revision-Date: 2000-06-02 19:20-0300\n"
11 "Last-Translator: André Luiz Fassone <[email protected]>\n"
12 "Language-Team: Brazilian Portuguese <debian-l10n-"
13 "[email protected]>\n"
14 "Language: pt_BR\n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
19 "X-Generator: Virtaal 1.0.0-beta1\n"
20
21 #. type: TH
22 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
23 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
24 #, fuzzy, no-wrap
25 #| msgid "B<getaddrinfo>()"
26 msgid "getaddrinfo"
27 msgstr "B<getaddrinfo>()"
28
29 #. type: TH
30 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
31 #: opensuse-tumbleweed
32 #, no-wrap
33 msgid "2026-02-08"
34 msgstr "8 fevereiro 2026"
35
36 #. type: TH
37 #: archlinux debian-unstable
38 #, fuzzy, no-wrap
39 #| msgid "Linux man-pages 6.17"
40 msgid "Linux man-pages 6.18"
41 msgstr "Linux man-pages 6.17"
42
43 #. type: SH
44 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
45 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
46 #, no-wrap
47 msgid "NAME"
48 msgstr "NOME"
49
50 #. type: Plain text
51 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
52 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
53 msgid ""
54 "getaddrinfo, freeaddrinfo, gai_strerror - network address and service "
55 "translation"
56 msgstr ""
57 "getaddrinfo, freeaddrinfo, gai_strerror - tradução de endereço de rede e "
58 "serviço"
59
60 #. type: SH
61 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
62 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
63 #, no-wrap
64 msgid "LIBRARY"
65 msgstr "BIBLIOTECA"
66
67 #. type: Plain text
68 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
69 #: opensuse-leap-16-1 opensuse-tumbleweed
70 msgid "Standard C library (I<libc>,\\ I<-lc>)"
71 msgstr "Biblioteca C Padrão (I<libc>,\\ I<-lc>)"
72
73 #. type: SH
74 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
75 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
76 #, no-wrap
77 msgid "SYNOPSIS"
78 msgstr "SINOPSE"
79
80 #. type: Plain text
81 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
82 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
83 #, no-wrap
84 msgid ""
85 "B<#include E<lt>sys/types.hE<gt>>\n"
86 "B<#include E<lt>sys/socket.hE<gt>>\n"
87 "B<#include E<lt>netdb.hE<gt>>\n"
88 msgstr ""
89 "B<#include E<lt>sys/types.hE<gt>>\n"
90 "B<#include E<lt>sys/socket.hE<gt>>\n"
91 "B<#include E<lt>netdb.hE<gt>>\n"
92
93 #. type: Plain text
94 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
95 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
96 #, fuzzy, no-wrap
97 #| msgid ""
98 #| "B<int getaddrinfo(const char *>I<node>B<, const char *>I<service>B<,>\n"
99 #| "B< const struct addrinfo *>I<hints>B<,>\n"
100 #| "B< struct addrinfo **>I<res>B<);>\n"
101 msgid ""
102 "B<int getaddrinfo(const char *restrict >I<node>B<,>\n"
103 "B< const char *restrict >I<service>B<,>\n"
104 "B< const struct addrinfo *restrict >I<hints>B<,>\n"
105 "B< struct addrinfo **restrict >I<res>B<);>\n"
106 msgstr ""
107 "B<int getaddrinfo(const char *>I<node>B<, const char *>I<service>B<,>\n"
108 "B< const struct addrinfo *>I<hints>B<,>\n"
109 "B< struct addrinfo **>I<res>B<);>\n"
110
111 #. type: Plain text
112 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
113 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
114 #, no-wrap
115 msgid "B<void freeaddrinfo(struct addrinfo *>I<res>B<);>\n"
116 msgstr "B<void freeaddrinfo(struct addrinfo *>I<res>B<);>\n"
117
118 #. type: Plain text
119 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
120 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
121 #, no-wrap
122 msgid "B<const char *gai_strerror(int >I<errcode>B<);>\n"
123 msgstr "B<const char *gai_strerror(int >I<errcode>B<);>\n"
124
125 #. type: Plain text
126 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
127 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
128 msgid ""
129 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
130 msgstr ""
131 "Requisitos de macro de teste de recursos para o glibc (consulte "
132 "B<feature_test_macros>(7)):"
133
134 #. type: Plain text
135 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
136 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
137 #, fuzzy
138 #| msgid ""
139 #| "B<freeaddrinfo>(),\n"
140 #| "B<gai_strerror>()"
141 msgid "B<getaddrinfo>(), B<freeaddrinfo>(), B<gai_strerror>():"
142 msgstr ""
143 "B<freeaddrinfo>(),\n"
144 "B<gai_strerror>()"
145
146 #. type: Plain text
147 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
148 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
149 #, fuzzy, no-wrap
150 #| msgid ""
151 #| "/* Since glibc 2.10: */ _POSIX_C_SOURCE\\ E<gt>=\\ 200809L\n"
152 #| " || /* Glibc versions E<lt>= 2.19: */ _BSD_SOURCE || _SVID_SOURCE\n"
153 msgid ""
154 " Since glibc 2.22:\n"
155 " _POSIX_C_SOURCE E<gt>= 200112L\n"
156 " glibc 2.21 and earlier:\n"
157 " _POSIX_C_SOURCE\n"
158 msgstr ""
159 "/* Desde o 2.10: */ _POSIX_C_SOURCE\\ E<gt>=\\ 200809L\n"
160 " || /* Glibc versões E<lt>= 2.19: */ _BSD_SOURCE || _SVID_SOURCE\n"
161
162 #. type: SH
163 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
164 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
165 #, no-wrap
166 msgid "DESCRIPTION"
167 msgstr "DESCRIÇÃO"
168
169 #. .BR getipnodebyname (3),
170 #. .BR getipnodebyaddr (3),
171 #. type: Plain text
172 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
173 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
174 msgid ""
175 "Given I<node> and I<service>, which identify an Internet host and a service, "
176 "B<getaddrinfo>() returns one or more I<addrinfo> structures, each of which "
177 "contains an Internet address that can be specified in a call to B<bind>(2) "
178 "or B<connect>(2). The B<getaddrinfo>() function combines the functionality "
179 "provided by the B<gethostbyname>(3) and B<getservbyname>(3) functions into "
180 "a single interface, but unlike the latter functions, B<getaddrinfo>() is "
181 "reentrant and allows programs to eliminate IPv4-versus-IPv6 dependencies."
182 msgstr ""
183
184 #. type: Plain text
185 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
186 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
187 msgid ""
188 "The I<addrinfo> structure used by B<getaddrinfo>() contains the following "
189 "fields:"
190 msgstr ""
191 "A estrutura I<addrinfo> usada por B<getaddrinfo>() contém os seguintes "
192 "campos:"
193
194 #. type: Plain text
195 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
196 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
197 #, no-wrap
198 msgid ""
199 "struct addrinfo {\n"
200 " int ai_flags;\n"
201 " int ai_family;\n"
202 " int ai_socktype;\n"
203 " int ai_protocol;\n"
204 " socklen_t ai_addrlen;\n"
205 " struct sockaddr *ai_addr;\n"
206 " char *ai_canonname;\n"
207 " struct addrinfo *ai_next;\n"
208 "};\n"
209 msgstr ""
210 "struct addrinfo {\n"
211 " int ai_flags;\n"
212 " int ai_family;\n"
213 " int ai_socktype;\n"
214 " int ai_protocol;\n"
215 " socklen_t ai_addrlen;\n"
216 " struct sockaddr *ai_addr;\n"
217 " char *ai_canonname;\n"
218 " struct addrinfo *ai_next;\n"
219 "};\n"
220
221 #. type: Plain text
222 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
223 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
224 msgid ""
225 "The I<hints> argument points to an I<addrinfo> structure that specifies "
226 "criteria for selecting the socket address structures returned in the list "
227 "pointed to by I<res>. If I<hints> is not NULL it points to an I<addrinfo> "
228 "structure whose I<ai_family>, I<ai_socktype>, and I<ai_protocol> specify "
229 "criteria that limit the set of socket addresses returned by "
230 "B<getaddrinfo>(), as follows:"
231 msgstr ""
232
233 #. type: TP
234 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
235 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
236 #, no-wrap
237 msgid "I<ai_family>"
238 msgstr "I<ai_family>"
239
240 #. type: Plain text
241 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
242 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
243 msgid ""
244 "This field specifies the desired address family for the returned addresses. "
245 "Valid values for this field include B<AF_INET> and B<AF_INET6>. The value "
246 "B<AF_UNSPEC> indicates that B<getaddrinfo>() should return socket addresses "
247 "for any address family (either IPv4 or IPv6, for example) that can be used "
248 "with I<node> and I<service>."
249 msgstr ""
250
251 #. type: TP
252 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
253 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
254 #, no-wrap
255 msgid "I<ai_socktype>"
256 msgstr "I<ai_socktype>"
257
258 #. type: Plain text
259 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
260 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
261 msgid ""
262 "This field specifies the preferred socket type, for example B<SOCK_STREAM> "
263 "or B<SOCK_DGRAM>. Specifying 0 in this field indicates that socket "
264 "addresses of any type can be returned by B<getaddrinfo>()."
265 msgstr ""
266
267 #. type: TP
268 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
269 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
270 #, no-wrap
271 msgid "I<ai_protocol>"
272 msgstr "I<ai_protocol>"
273
274 #. type: Plain text
275 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
276 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
277 msgid ""
278 "This field specifies the protocol for the returned socket addresses. "
279 "Specifying 0 in this field indicates that socket addresses with any protocol "
280 "can be returned by B<getaddrinfo>()."
281 msgstr ""
282
283 #. type: TP
284 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
285 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
286 #, no-wrap
287 msgid "I<ai_flags>"
288 msgstr "I<ai_flags>"
289
290 #. type: Plain text
291 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
292 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
293 msgid ""
294 "This field specifies additional options, described below. Multiple flags "
295 "are specified by bitwise OR-ing them together."
296 msgstr ""
297
298 #. type: Plain text
299 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
300 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
301 msgid ""
302 "All the other fields in the structure pointed to by I<hints> must contain "
303 "either 0 or a null pointer, as appropriate."
304 msgstr ""
305
306 #. type: Plain text
307 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
308 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
309 #, fuzzy
310 #| msgid ""
311 #| "The I<node> or I<service> parameter, but not both, may be NULL. I<node> "
312 #| "specifies either a numerical network address (dotted-decimal format for "
313 #| "IPv4, hexadecimal format for IPv6) or a network hostname, whose network "
314 #| "addresses are looked up and resolved. If the I<ai_flags> member in the "
315 #| "I<hints> parameter contains the B<AI_NUMERICHOST> flag then the I<node> "
316 #| "parameter must be a numerical network address. The B<AI_NUMERICHOST> "
317 #| "flag suppresses any potentially lengthy network host address lookups."
318 msgid ""
319 "Specifying I<hints> as NULL is equivalent to setting I<ai_socktype> and "
320 "I<ai_protocol> to 0; I<ai_family> to B<AF_UNSPEC>; and I<ai_flags> to "
321 "B<(AI_V4MAPPED\\ |\\ AI_ADDRCONFIG)>. (POSIX specifies different defaults "
322 "for I<ai_flags>; see NOTES.) I<node> specifies either a numerical network "
323 "address (for IPv4, numbers-and-dots notation as supported by "
324 "B<inet_aton>(3); for IPv6, hexadecimal string format as supported by "
325 "B<inet_pton>(3)), or a network hostname, whose network addresses are looked "
326 "up and resolved. If I<hints.ai_flags> contains the B<AI_NUMERICHOST> flag, "
327 "then I<node> must be a numerical network address. The B<AI_NUMERICHOST> "
328 "flag suppresses any potentially lengthy network host address lookups."
329 msgstr ""
330 "O parâmetro I<node> ou I<service>, mas não ambos, podem ser NULO. I<node> "
331 "especifica um endereço numérico de rede (formato separado por pontos para "
332 "IPv4, formato hexadecimal para IPv6) ou um nome de 'host' da rede, cujos "
333 "endereços de rede são procurados e resolvidos. Se o membro I<ai_flags> no "
334 "parâmetro I<hints> contém um sinalizador B<AI_NUMERICHOST>, então o "
335 "parâmetro I<node> deve ser um endereço numérico de rede. Um sinalizador "
336 "B<AI_NUMERICHOST> suprime qualquer procura de endereço de 'host' da rede que "
337 "seja potencialmente longo."
338
339 #. type: Plain text
340 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
341 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
342 msgid ""
343 "If the B<AI_PASSIVE> flag is specified in I<hints.ai_flags>, and I<node> is "
344 "NULL, then the returned socket addresses will be suitable for B<bind>(2)ing "
345 "a socket that will B<accept>(2) connections. The returned socket address "
346 "will contain the \"wildcard address\" (B<INADDR_ANY> for IPv4 addresses, "
347 "B<IN6ADDR_ANY_INIT> for IPv6 address). The wildcard address is used by "
348 "applications (typically servers) that intend to accept connections on any "
349 "of the host's network addresses. If I<node> is not NULL, then the "
350 "B<AI_PASSIVE> flag is ignored."
351 msgstr ""
352
353 #. type: Plain text
354 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
355 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
356 msgid ""
357 "If the B<AI_PASSIVE> flag is not set in I<hints.ai_flags>, then the returned "
358 "socket addresses will be suitable for use with B<connect>(2), B<sendto>(2), "
359 "or B<sendmsg>(2). If I<node> is NULL, then the network address will be set "
360 "to the loopback interface address (B<INADDR_LOOPBACK> for IPv4 addresses, "
361 "B<IN6ADDR_LOOPBACK_INIT> for IPv6 address); this is used by applications "
362 "that intend to communicate with peers running on the same host."
363 msgstr ""
364
365 #. type: Plain text
366 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
367 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
368 msgid ""
369 "I<service> sets the port in each returned address structure. If this "
370 "argument is a service name (see B<services>(5)), it is translated to the "
371 "corresponding port number. This argument can also be specified as a decimal "
372 "number, which is simply converted to binary. If I<service> is NULL, then "
373 "the port number of the returned socket addresses will be left "
374 "uninitialized. If B<AI_NUMERICSERV> is specified in I<hints.ai_flags> and "
375 "I<service> is not NULL, then I<service> must point to a string containing a "
376 "numeric port number. This flag is used to inhibit the invocation of a name "
377 "resolution service in cases where it is known not to be required."
378 msgstr ""
379
380 #. type: Plain text
381 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
382 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
383 msgid "Either I<node> or I<service>, but not both, may be NULL."
384 msgstr ""
385
386 #. type: Plain text
387 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
388 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
389 msgid ""
390 "The B<getaddrinfo>() function allocates and initializes a linked list of "
391 "I<addrinfo> structures, one for each network address that matches I<node> "
392 "and I<service>, subject to any restrictions imposed by I<hints>, and returns "
393 "a pointer to the start of the list in I<res>. The items in the linked list "
394 "are linked by the I<ai_next> field."
395 msgstr ""
396
397 #. type: Plain text
398 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
399 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
400 msgid ""
401 "There are several reasons why the linked list may have more than one "
402 "I<addrinfo> structure, including: the network host is multihomed, accessible "
403 "over multiple protocols (e.g., both B<AF_INET> and B<AF_INET6>); or the same "
404 "service is available from multiple socket types (one B<SOCK_STREAM> address "
405 "and another B<SOCK_DGRAM> address, for example). Normally, the application "
406 "should try using the addresses in the order in which they are returned. The "
407 "sorting function used within B<getaddrinfo>() is defined in RFC\\ 3484; the "
408 "order can be tweaked for a particular system by editing I</etc/gai.conf> "
409 "(available since glibc 2.5)."
410 msgstr ""
411
412 #. Prior to glibc 2.3.4, the ai_canonname of each addrinfo
413 #. structure was set pointing to the canonical name; that was
414 #. more than POSIX.1-2001 specified, or other implementations provided.
415 #. MTK, Aug 05
416 #. type: Plain text
417 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
418 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
419 msgid ""
420 "If I<hints.ai_flags> includes the B<AI_CANONNAME> flag, then the "
421 "I<ai_canonname> field of the first of the I<addrinfo> structures in the "
422 "returned list is set to point to the official name of the host."
423 msgstr ""
424
425 #. type: Plain text
426 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
427 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
428 msgid ""
429 "The remaining fields of each returned I<addrinfo> structure are initialized "
430 "as follows:"
431 msgstr ""
432
433 #. type: IP
434 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
435 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
436 #, no-wrap
437 msgid "\\[bu]"
438 msgstr "\\[bu]"
439
440 #. type: Plain text
441 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
442 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
443 msgid ""
444 "The I<ai_family>, I<ai_socktype>, and I<ai_protocol> fields return the "
445 "socket creation parameters (i.e., these fields have the same meaning as the "
446 "corresponding arguments of B<socket>(2)). For example, I<ai_family> might "
447 "return B<AF_INET> or B<AF_INET6>; I<ai_socktype> might return B<SOCK_DGRAM> "
448 "or B<SOCK_STREAM>; and I<ai_protocol> returns the protocol for the socket."
449 msgstr ""
450
451 #. type: Plain text
452 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
453 #: opensuse-leap-16-1 opensuse-tumbleweed
454 msgid ""
455 "A pointer to the socket address is placed in the I<ai_addr> field, and the "
456 "size of the socket address, in bytes, is placed in the I<ai_addrlen> field."
457 msgstr ""
458
459 #. type: Plain text
460 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
461 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
462 msgid ""
463 "If I<hints.ai_flags> includes the B<AI_ADDRCONFIG> flag, then IPv4 addresses "
464 "are returned in the list pointed to by I<res> only if the local system has "
465 "at least one IPv4 address configured, and IPv6 addresses are returned only "
466 "if the local system has at least one IPv6 address configured. The loopback "
467 "address is not considered for this case as valid as a configured address. "
468 "This flag is useful on, for example, IPv4-only systems, to ensure that "
469 "B<getaddrinfo>() does not return IPv6 socket addresses that would always "
470 "fail in B<connect>(2) or B<bind>(2)."
471 msgstr ""
472
473 #. type: Plain text
474 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
475 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
476 msgid ""
477 "If I<hints.ai_flags> specifies the B<AI_V4MAPPED> flag, and "
478 "I<hints.ai_family> was specified as B<AF_INET6>, and no matching IPv6 "
479 "addresses could be found, then return IPv4-mapped IPv6 addresses in the list "
480 "pointed to by I<res>. If both B<AI_V4MAPPED> and B<AI_ALL> are specified in "
481 "I<hints.ai_flags>, then return both IPv6 and IPv4-mapped IPv6 addresses in "
482 "the list pointed to by I<res>. B<AI_ALL> is ignored if B<AI_V4MAPPED> is "
483 "not also specified."
484 msgstr ""
485
486 #. type: Plain text
487 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
488 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
489 #, fuzzy
490 #| msgid ""
491 #| "The B<freeaddrinfo>(3) function frees the memory that was allocated for "
492 #| "the dynamically allocated link list I<res>."
493 msgid ""
494 "The B<freeaddrinfo>() function frees the memory that was allocated for the "
495 "dynamically allocated linked list I<res>."
496 msgstr ""
497 "A função B<freeaddrinfo>(3) libera a memória que foi alocada para a lista de "
498 "ligação alocada dinamicamente I<res>."
499
500 #. type: SS
501 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
502 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
503 #, no-wrap
504 msgid "Extensions to getaddrinfo() for Internationalized Domain Names"
505 msgstr ""
506
507 #. type: Plain text
508 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
509 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
510 msgid ""
511 "Starting with glibc 2.3.4, B<getaddrinfo>() has been extended to "
512 "selectively allow the incoming and outgoing hostnames to be transparently "
513 "converted to and from the Internationalized Domain Name (IDN) format (see "
514 "RFC 3490, I<Internationalizing Domain Names in Applications (IDNA)>). Four "
515 "new flags are defined:"
516 msgstr ""
517
518 #. type: TP
519 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
520 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
521 #, no-wrap
522 msgid "B<AI_IDN>"
523 msgstr "B<AI_IDN>"
524
525 #. type: Plain text
526 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
527 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
528 msgid ""
529 "If this flag is specified, then the node name given in I<node> is converted "
530 "to IDN format if necessary. The source encoding is that of the current "
531 "locale."
532 msgstr ""
533
534 #. Implementation Detail:
535 #. To minimize effects on system performance the implementation might
536 #. want to check whether the input string contains any non-ASCII
537 #. characters. If there are none the IDN step can be skipped completely.
538 #. On systems which allow not-ASCII safe encodings for a locale this
539 #. might be a problem.
540 #. type: Plain text
541 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
542 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
543 msgid ""
544 "If the input name contains non-ASCII characters, then the IDN encoding is "
545 "used. Those parts of the node name (delimited by dots) that contain non-"
546 "ASCII characters are encoded using ASCII Compatible Encoding (ACE) before "
547 "being passed to the name resolution functions."
548 msgstr ""
549
550 #. type: TP
551 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
552 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
553 #, no-wrap
554 msgid "B<AI_CANONIDN>"
555 msgstr "B<AI_CANONIDN>"
556
557 #. type: Plain text
558 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
559 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
560 msgid ""
561 "After a successful name lookup, and if the B<AI_CANONNAME> flag was "
562 "specified, B<getaddrinfo>() will return the canonical name of the node "
563 "corresponding to the I<addrinfo> structure value passed back. The return "
564 "value is an exact copy of the value returned by the name resolution function."
565 msgstr ""
566
567 #
568 #. Implementation Detail:
569 #. If no component of the returned name starts with xn\-\- the IDN
570 #. step can be skipped, therefore avoiding unnecessary slowdowns.
571 #. type: Plain text
572 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
573 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
574 msgid ""
575 "If the name is encoded using ACE, then it will contain the I<xn--> prefix "
576 "for one or more components of the name. To convert these components into a "
577 "readable form the B<AI_CANONIDN> flag can be passed in addition to "
578 "B<AI_CANONNAME>. The resulting string is encoded using the current locale's "
579 "encoding."
580 msgstr ""
581
582 #. type: TP
583 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
584 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
585 #, fuzzy, no-wrap
586 #| msgid "B<AI_IDN_ALLOW_UNASSIGNED>, B<AI_IDN_USE_STD3_ASCII_RULES>"
587 msgid "B<AI_IDN_ALLOW_UNASSIGNED>"
588 msgstr "B<AI_IDN_ALLOW_UNASSIGNED>, B<AI_IDN_USE_STD3_ASCII_RULES>"
589
590 #. type: TQ
591 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
592 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
593 #, fuzzy, no-wrap
594 #| msgid "B<AI_IDN_ALLOW_UNASSIGNED>, B<AI_IDN_USE_STD3_ASCII_RULES>"
595 msgid "B<AI_IDN_USE_STD3_ASCII_RULES>"
596 msgstr "B<AI_IDN_ALLOW_UNASSIGNED>, B<AI_IDN_USE_STD3_ASCII_RULES>"
597
598 #. type: Plain text
599 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
600 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
601 msgid ""
602 "Setting these flags will enable the IDNA_ALLOW_UNASSIGNED (allow unassigned "
603 "Unicode code points) and IDNA_USE_STD3_ASCII_RULES (check output to make "
604 "sure it is a STD3 conforming hostname) flags respectively to be used in the "
605 "IDNA handling."
606 msgstr ""
607
608 #. type: SH
609 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
610 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
611 #, no-wrap
612 msgid "RETURN VALUE"
613 msgstr "VALOR DE RETORNO"
614
615 #. FIXME glibc defines the following additional errors, some which
616 #. can probably be returned by getaddrinfo(); they need to
617 #. be documented.
618 #. #ifdef __USE_GNU
619 #. #define EAI_INPROGRESS -100 /* Processing request in progress. */
620 #. #define EAI_CANCELED -101 /* Request canceled. */
621 #. #define EAI_NOTCANCELED -102 /* Request not canceled. */
622 #. #define EAI_ALLDONE -103 /* All requests done. */
623 #. #define EAI_INTR -104 /* Interrupted by a signal. */
624 #. #define EAI_IDN_ENCODE -105 /* IDN encoding failed. */
625 #. #endif
626 #. type: Plain text
627 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
628 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
629 msgid ""
630 "B<getaddrinfo>() returns 0 if it succeeds, or one of the following nonzero "
631 "error codes:"
632 msgstr ""
633 "B<getaddrinfo>() retorna 0 se for bem-sucedido, ou um dos códigos de erro "
634 "diferentes de zero:"
635
636 #. type: TP
637 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
638 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
639 #, no-wrap
640 msgid "B<EAI_ADDRFAMILY>"
641 msgstr "B<EAI_ADDRFAMILY>"
642
643 #. Not in SUSv3
644 #. type: Plain text
645 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
646 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
647 msgid ""
648 "The specified network host does not have any network addresses in the "
649 "requested address family."
650 msgstr ""
651 "O 'host' de rede especificado não tem quaisquer endereços de rede na família "
652 "de endereço requerida."
653
654 #. type: TP
655 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
656 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
657 #, no-wrap
658 msgid "B<EAI_AGAIN>"
659 msgstr "B<EAI_AGAIN>"
660
661 #. type: Plain text
662 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
663 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
664 msgid ""
665 "The name server returned a temporary failure indication. Try again later."
666 msgstr ""
667 "O servidor de nome retornou uma indicação de falha temporária. Tente "
668 "novamente mais tarde."
669
670 #. type: TP
671 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
672 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
673 #, no-wrap
674 msgid "B<EAI_BADFLAGS>"
675 msgstr "B<EAI_BADFLAGS>"
676
677 #. type: Plain text
678 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
679 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
680 msgid ""
681 "I<hints.ai_flags> contains invalid flags; or, I<hints.ai_flags> included "
682 "B<AI_CANONNAME> and I<node> was NULL."
683 msgstr ""
684
685 #. type: TP
686 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
687 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
688 #, no-wrap
689 msgid "B<EAI_FAIL>"
690 msgstr "B<EAI_FAIL>"
691
692 #. type: Plain text
693 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
694 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
695 msgid "The name server returned a permanent failure indication."
696 msgstr "O servidor de nomes retornou uma indicação de falha permanente."
697
698 #. type: TP
699 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
700 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
701 #, no-wrap
702 msgid "B<EAI_FAMILY>"
703 msgstr "B<EAI_FAMILY>"
704
705 #. type: Plain text
706 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
707 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
708 #, fuzzy
709 #| msgid "The requested address family is not supported at all."
710 msgid "The requested address family is not supported."
711 msgstr "A família de endereço requerida não é suportada de jeito nenhum."
712
713 #. type: TP
714 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
715 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
716 #, no-wrap
717 msgid "B<EAI_MEMORY>"
718 msgstr "B<EAI_MEMORY>"
719
720 #. type: Plain text
721 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
722 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
723 msgid "Out of memory."
724 msgstr "Sem memória."
725
726 #. type: TP
727 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
728 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
729 #, no-wrap
730 msgid "B<EAI_NODATA>"
731 msgstr "B<EAI_NODATA>"
732
733 #. Not in SUSv3
734 #. type: Plain text
735 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
736 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
737 msgid ""
738 "The specified network host exists, but does not have any network addresses "
739 "defined."
740 msgstr ""
741 "O 'host' de rede especificado existe, mas não tem qualquer endereço de rede "
742 "definido."
743
744 #. type: TP
745 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
746 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
747 #, no-wrap
748 msgid "B<EAI_NONAME>"
749 msgstr "B<EAI_NONAME>"
750
751 #. type: Plain text
752 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
753 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
754 msgid ""
755 "The I<node> or I<service> is not known; or both I<node> and I<service> are "
756 "NULL; or B<AI_NUMERICSERV> was specified in I<hints.ai_flags> and I<service> "
757 "was not a numeric port-number string."
758 msgstr ""
759
760 #. type: TP
761 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
762 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
763 #, no-wrap
764 msgid "B<EAI_SERVICE>"
765 msgstr "B<EAI_SERVICE>"
766
767 #. type: Plain text
768 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
769 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
770 msgid ""
771 "The requested service is not available for the requested socket type. It "
772 "may be available through another socket type. For example, this error could "
773 "occur if I<service> was \"shell\" (a service available only on stream "
774 "sockets), and either I<hints.ai_protocol> was B<IPPROTO_UDP>, or "
775 "I<hints.ai_socktype> was B<SOCK_DGRAM>; or the error could occur if "
776 "I<service> was not NULL, and I<hints.ai_socktype> was B<SOCK_RAW> (a socket "
777 "type that does not support the concept of services)."
778 msgstr ""
779
780 #. type: TP
781 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
782 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
783 #, no-wrap
784 msgid "B<EAI_SOCKTYPE>"
785 msgstr "B<EAI_SOCKTYPE>"
786
787 #. type: Plain text
788 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
789 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
790 msgid ""
791 "The requested socket type is not supported. This could occur, for example, "
792 "if I<hints.ai_socktype> and I<hints.ai_protocol> are inconsistent (e.g., "
793 "B<SOCK_DGRAM> and B<IPPROTO_TCP>, respectively)."
794 msgstr ""
795
796 #. type: TP
797 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
798 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
799 #, no-wrap
800 msgid "B<EAI_SYSTEM>"
801 msgstr "B<EAI_SYSTEM>"
802
803 #. type: Plain text
804 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
805 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
806 #, fuzzy
807 #| msgid ""
808 #| "On success, zero is returned. On error, -1 is returned, and I<errno> is "
809 #| "set to indicate the error."
810 msgid "Other system error; I<errno> is set to indicate the error."
811 msgstr ""
812 "Em caso de sucesso, zero é retornado. Em caso de erro, -1 é retornado, e "
813 "I<errno> é definido para indicar o erro."
814
815 #. type: Plain text
816 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
817 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
818 msgid ""
819 "The B<gai_strerror>() function translates these error codes to a human "
820 "readable string, suitable for error reporting."
821 msgstr ""
822 "A função B<gai_strerror>() traduz estes códigos de erro para uma string "
823 "legível para o homem, confiável para o relato de erros."
824
825 #. type: SH
826 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
827 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
828 #, no-wrap
829 msgid "FILES"
830 msgstr "ARQUIVOS"
831
832 #. type: Plain text
833 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
834 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
835 msgid "I</etc/gai.conf>"
836 msgstr "I</etc/gai.conf>"
837
838 #. type: SH
839 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
840 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
841 #, no-wrap
842 msgid "ATTRIBUTES"
843 msgstr "ATRIBUTOS"
844
845 #. type: Plain text
846 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
847 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
848 msgid ""
849 "For an explanation of the terms used in this section, see B<attributes>(7)."
850 msgstr ""
851 "Para uma explicação dos termos usados nesta seção, consulte B<attributes>(7)."
852
853 #. type: tbl table
854 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
855 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
856 #, no-wrap
857 msgid "Interface"
858 msgstr "Interface"
859
860 #. type: tbl table
861 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
862 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
863 #, no-wrap
864 msgid "Attribute"
865 msgstr "Atributo"
866
867 #. type: tbl table
868 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
869 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
870 #, no-wrap
871 msgid "Value"
872 msgstr "Valor"
873
874 #. type: tbl table
875 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
876 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
877 #, no-wrap
878 msgid ".na\n"
879 msgstr ".na\n"
880
881 #. type: tbl table
882 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
883 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
884 #, no-wrap
885 msgid ".nh\n"
886 msgstr ".nh\n"
887
888 #. type: TP
889 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
890 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
891 #, no-wrap
892 msgid "B<getaddrinfo>()"
893 msgstr "B<getaddrinfo>()"
894
895 #. type: tbl table
896 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
897 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
898 #, no-wrap
899 msgid "Thread safety"
900 msgstr "Thread safety"
901
902 #. type: tbl table
903 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
904 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
905 #, no-wrap
906 msgid "MT-Safe env locale"
907 msgstr "MT-Safe env locale"
908
909 #. type: tbl table
910 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
911 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
912 #, no-wrap
913 msgid ""
914 "B<freeaddrinfo>(),\n"
915 "B<gai_strerror>()"
916 msgstr ""
917 "B<freeaddrinfo>(),\n"
918 "B<gai_strerror>()"
919
920 #. type: tbl table
921 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
922 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
923 #, no-wrap
924 msgid "MT-Safe"
925 msgstr "MT-Safe"
926
927 #. type: SH
928 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
929 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
930 #, no-wrap
931 msgid "VERSIONS"
932 msgstr "VERSÕES"
933
934 #. POSIX.1-2001, POSIX.1-2008
935 #. type: Plain text
936 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
937 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
938 msgid ""
939 "According to POSIX.1, specifying I<hints> as NULL should cause I<ai_flags> "
940 "to be assumed as 0. The GNU C library instead assumes a value of "
941 "B<(AI_V4MAPPED\\ |\\ AI_ADDRCONFIG)> for this case, since this value is "
942 "considered an improvement on the specification."
943 msgstr ""
944
945 #. type: SH
946 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
947 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
948 #, no-wrap
949 msgid "STANDARDS"
950 msgstr "PADRÕES"
951
952 #. type: Plain text
953 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
954 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
955 msgid "POSIX.1-2008."
956 msgstr "POSIX.1-2008."
957
958 #. type: Plain text
959 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
960 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
961 msgid "RFC\\ 2553."
962 msgstr ""
963
964 #. type: SH
965 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
966 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
967 #, no-wrap
968 msgid "HISTORY"
969 msgstr "HISTÓRICO"
970
971 #. type: Plain text
972 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
973 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
974 msgid "POSIX.1-2001."
975 msgstr "POSIX.1-2001."
976
977 #. type: TP
978 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
979 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
980 #, fuzzy, no-wrap
981 #| msgid "B<EAI_ADDRFAMILY>"
982 msgid "B<AI_ADDRCONFIG>"
983 msgstr "B<EAI_ADDRFAMILY>"
984
985 #. type: TQ
986 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
987 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
988 #, fuzzy, no-wrap
989 #| msgid "B<LC_ALL>"
990 msgid "B<AI_ALL>"
991 msgstr "B<LC_ALL>"
992
993 #. type: TQ
994 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
995 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
996 #, fuzzy, no-wrap
997 #| msgid "B<AI_IDN>"
998 msgid "B<AI_V4MAPPED>"
999 msgstr "B<AI_IDN>"
1000
1001 #. type: Plain text
1002 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1003 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1004 msgid "glibc 2.3.3."
1005 msgstr ""
1006
1007 #. type: TP
1008 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1009 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1010 #, fuzzy, no-wrap
1011 #| msgid "B<LC_NUMERIC>"
1012 msgid "B<AI_NUMERICSERV>"
1013 msgstr "B<LC_NUMERIC>"
1014
1015 #. type: Plain text
1016 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1017 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1018 msgid "glibc 2.3.4."
1019 msgstr "glibc 2.3.4."
1020
1021 #. type: SH
1022 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1023 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1024 #, no-wrap
1025 msgid "NOTES"
1026 msgstr "NOTAS"
1027
1028 #. type: Plain text
1029 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1030 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1031 msgid ""
1032 "B<getaddrinfo>() supports the I<address>B<%>I<scope-id> notation for "
1033 "specifying the IPv6 scope-ID."
1034 msgstr ""
1035
1036 #. type: SH
1037 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1038 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1039 #, no-wrap
1040 msgid "EXAMPLES"
1041 msgstr "EXEMPLOS"
1042
1043 #. getnameinfo.3 refers to this example
1044 #. socket.2 refers to this example
1045 #. bind.2 refers to this example
1046 #. connect.2 refers to this example
1047 #. recvfrom.2 refers to this example
1048 #. sendto.2 refers to this example
1049 #. type: Plain text
1050 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1051 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1052 msgid ""
1053 "The following programs demonstrate the use of B<getaddrinfo>(), "
1054 "B<gai_strerror>(), B<freeaddrinfo>(), and B<getnameinfo>(3). The programs "
1055 "are an echo server and client for UDP datagrams."
1056 msgstr ""
1057
1058 #. type: SS
1059 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1060 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1061 #, no-wrap
1062 msgid "Server program"
1063 msgstr ""
1064
1065 #. type: Plain text
1066 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1067 #: opensuse-tumbleweed
1068 #, no-wrap
1069 msgid ""
1070 "#include E<lt>netdb.hE<gt>\n"
1071 "#include E<lt>stdio.hE<gt>\n"
1072 "#include E<lt>stdlib.hE<gt>\n"
1073 "#include E<lt>string.hE<gt>\n"
1074 "#include E<lt>sys/socket.hE<gt>\n"
1075 "#include E<lt>sys/types.hE<gt>\n"
1076 "#include E<lt>unistd.hE<gt>\n"
1077 "\\&\n"
1078 "#define BUF_SIZE 500\n"
1079 "\\&\n"
1080 "int\n"
1081 "main(int argc, char *argv[])\n"
1082 "{\n"
1083 " int sfd, s;\n"
1084 " char buf[BUF_SIZE];\n"
1085 " ssize_t nread;\n"
1086 " socklen_t peer_addrlen;\n"
1087 " struct addrinfo hints;\n"
1088 " struct addrinfo *result, *rp;\n"
1089 " struct sockaddr_storage peer_addr;\n"
1090 "\\&\n"
1091 " if (argc != 2) {\n"
1092 " fprintf(stderr, \"Usage: %s port\\[rs]n\", argv[0]);\n"
1093 " exit(EXIT_FAILURE);\n"
1094 " }\n"
1095 "\\&\n"
1096 " memset(&hints, 0, sizeof(hints));\n"
1097 " hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */\n"
1098 " hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */\n"
1099 " hints.ai_flags = AI_PASSIVE; /* For wildcard IP address */\n"
1100 " hints.ai_protocol = 0; /* Any protocol */\n"
1101 " hints.ai_canonname = NULL;\n"
1102 " hints.ai_addr = NULL;\n"
1103 " hints.ai_next = NULL;\n"
1104 "\\&\n"
1105 " s = getaddrinfo(NULL, argv[1], &hints, &result);\n"
1106 " if (s != 0) {\n"
1107 " fprintf(stderr, \"getaddrinfo: %s\\[rs]n\", gai_strerror(s));\n"
1108 " exit(EXIT_FAILURE);\n"
1109 " }\n"
1110 "\\&\n"
1111 " /* getaddrinfo() returns a list of address structures.\n"
1112 " Try each address until we successfully bind(2).\n"
1113 " If socket(2) (or bind(2)) fails, we (close the socket\n"
1114 " and) try the next address. */\n"
1115 "\\&\n"
1116 " for (rp = result; rp != NULL; rp = rp-E<gt>ai_next) {\n"
1117 " sfd = socket(rp-E<gt>ai_family, rp-E<gt>ai_socktype,\n"
1118 " rp-E<gt>ai_protocol);\n"
1119 " if (sfd == -1)\n"
1120 " continue;\n"
1121 "\\&\n"
1122 " if (bind(sfd, rp-E<gt>ai_addr, rp-E<gt>ai_addrlen) == 0)\n"
1123 " break; /* Success */\n"
1124 "\\&\n"
1125 " close(sfd);\n"
1126 " }\n"
1127 "\\&\n"
1128 " freeaddrinfo(result); /* No longer needed */\n"
1129 "\\&\n"
1130 " if (rp == NULL) { /* No address succeeded */\n"
1131 " fprintf(stderr, \"Could not bind\\[rs]n\");\n"
1132 " exit(EXIT_FAILURE);\n"
1133 " }\n"
1134 "\\&\n"
1135 " /* Read datagrams and echo them back to sender. */\n"
1136 "\\&\n"
1137 " for (;;) {\n"
1138 " char host[NI_MAXHOST], service[NI_MAXSERV];\n"
1139 "\\&\n"
1140 " peer_addrlen = sizeof(peer_addr);\n"
1141 " nread = recvfrom(sfd, buf, BUF_SIZE, 0,\n"
1142 " (struct sockaddr *) &peer_addr, &peer_addrlen);\n"
1143 " if (nread == -1)\n"
1144 " continue; /* Ignore failed request */\n"
1145 "\\&\n"
1146 " s = getnameinfo((struct sockaddr *) &peer_addr,\n"
1147 " peer_addrlen, host, NI_MAXHOST,\n"
1148 " service, NI_MAXSERV, NI_NUMERICSERV);\n"
1149 " if (s == 0)\n"
1150 " printf(\"Received %zd bytes from %s:%s\\[rs]n\",\n"
1151 " nread, host, service);\n"
1152 " else\n"
1153 " fprintf(stderr, \"getnameinfo: %s\\[rs]n\", gai_strerror(s));\n"
1154 "\\&\n"
1155 " if (sendto(sfd, buf, nread, 0, (struct sockaddr *) &peer_addr,\n"
1156 " peer_addrlen) != nread)\n"
1157 " {\n"
1158 " fprintf(stderr, \"Error sending response\\[rs]n\");\n"
1159 " }\n"
1160 " }\n"
1161 "}\n"
1162 msgstr ""
1163
1164 #. SRC END
1165 #. type: SS
1166 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1167 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1168 #, no-wrap
1169 msgid "Client program"
1170 msgstr ""
1171
1172 #. type: Plain text
1173 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1174 #: opensuse-tumbleweed
1175 #, no-wrap
1176 msgid ""
1177 "#include E<lt>netdb.hE<gt>\n"
1178 "#include E<lt>stdio.hE<gt>\n"
1179 "#include E<lt>stdlib.hE<gt>\n"
1180 "#include E<lt>string.hE<gt>\n"
1181 "#include E<lt>sys/socket.hE<gt>\n"
1182 "#include E<lt>sys/types.hE<gt>\n"
1183 "#include E<lt>unistd.hE<gt>\n"
1184 "\\&\n"
1185 "#define BUF_SIZE 500\n"
1186 "\\&\n"
1187 "int\n"
1188 "main(int argc, char *argv[])\n"
1189 "{\n"
1190 " int sfd, s;\n"
1191 " char buf[BUF_SIZE];\n"
1192 " size_t size;\n"
1193 " ssize_t nread;\n"
1194 " struct addrinfo hints;\n"
1195 " struct addrinfo *result, *rp;\n"
1196 "\\&\n"
1197 " if (argc E<lt> 3) {\n"
1198 " fprintf(stderr, \"Usage: %s host port msg...\\[rs]n\", argv[0]);\n"
1199 " exit(EXIT_FAILURE);\n"
1200 " }\n"
1201 "\\&\n"
1202 " /* Obtain address(es) matching host/port. */\n"
1203 "\\&\n"
1204 " memset(&hints, 0, sizeof(hints));\n"
1205 " hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */\n"
1206 " hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */\n"
1207 " hints.ai_flags = 0;\n"
1208 " hints.ai_protocol = 0; /* Any protocol */\n"
1209 "\\&\n"
1210 " s = getaddrinfo(argv[1], argv[2], &hints, &result);\n"
1211 " if (s != 0) {\n"
1212 " fprintf(stderr, \"getaddrinfo: %s\\[rs]n\", gai_strerror(s));\n"
1213 " exit(EXIT_FAILURE);\n"
1214 " }\n"
1215 "\\&\n"
1216 " /* getaddrinfo() returns a list of address structures.\n"
1217 " Try each address until we successfully connect(2).\n"
1218 " If socket(2) (or connect(2)) fails, we (close the socket\n"
1219 " and) try the next address. */\n"
1220 "\\&\n"
1221 " for (rp = result; rp != NULL; rp = rp-E<gt>ai_next) {\n"
1222 " sfd = socket(rp-E<gt>ai_family, rp-E<gt>ai_socktype,\n"
1223 " rp-E<gt>ai_protocol);\n"
1224 " if (sfd == -1)\n"
1225 " continue;\n"
1226 "\\&\n"
1227 " if (connect(sfd, rp-E<gt>ai_addr, rp-E<gt>ai_addrlen) != -1)\n"
1228 " break; /* Success */\n"
1229 "\\&\n"
1230 " close(sfd);\n"
1231 " }\n"
1232 "\\&\n"
1233 " freeaddrinfo(result); /* No longer needed */\n"
1234 "\\&\n"
1235 " if (rp == NULL) { /* No address succeeded */\n"
1236 " fprintf(stderr, \"Could not connect\\[rs]n\");\n"
1237 " exit(EXIT_FAILURE);\n"
1238 " }\n"
1239 "\\&\n"
1240 " /* Send remaining command-line arguments as separate\n"
1241 " datagrams, and read responses from server. */\n"
1242 "\\&\n"
1243 " for (size_t j = 3; j E<lt> argc; j++) {\n"
1244 " size = strlen(argv[j]) + 1;\n"
1245 " /* +1 for terminating null byte */\n"
1246 "\\&\n"
1247 " if (size E<gt> BUF_SIZE) {\n"
1248 " fprintf(stderr,\n"
1249 " \"Ignoring long message in argument %zu\\[rs]n\", j);\n"
1250 " continue;\n"
1251 " }\n"
1252 "\\&\n"
1253 " if (write(sfd, argv[j], size) != size) {\n"
1254 " fprintf(stderr, \"partial/failed write\\[rs]n\");\n"
1255 " exit(EXIT_FAILURE);\n"
1256 " }\n"
1257 "\\&\n"
1258 " nread = read(sfd, buf, BUF_SIZE);\n"
1259 " if (nread == -1) {\n"
1260 " perror(\"read\");\n"
1261 " exit(EXIT_FAILURE);\n"
1262 " }\n"
1263 "\\&\n"
1264 " printf(\"Received %zd bytes: %s\\[rs]n\", nread, buf);\n"
1265 " }\n"
1266 "\\&\n"
1267 " exit(EXIT_SUCCESS);\n"
1268 "}\n"
1269 msgstr ""
1270
1271 #. SRC END
1272 #. type: SH
1273 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1274 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1275 #, no-wrap
1276 msgid "SEE ALSO"
1277 msgstr "VEJA TAMBÉM"
1278
1279 #. .BR getipnodebyaddr (3),
1280 #. .BR getipnodebyname (3),
1281 #. type: Plain text
1282 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1283 #: mageia-cauldron
1284 msgid ""
1285 "B<getaddrinfo_a>(3), B<gethostbyname>(3), B<getnameinfo>(3), B<inet>(3), "
1286 "B<gai.conf>(5), B<hostname>(7), B<ip>(7)"
1287 msgstr ""
1288 "B<getaddrinfo_a>(3), B<gethostbyname>(3), B<getnameinfo>(3), B<inet>(3), "
1289 "B<gai.conf>(5), B<hostname>(7), B<ip>(7)"
1290
1291 #. type: TH
1292 #: debian-trixie
1293 #, no-wrap
1294 msgid "2024-06-15"
1295 msgstr "15 junho 2024"
1296
1297 #. type: TH
1298 #: debian-trixie
1299 #, no-wrap
1300 msgid "Linux man-pages 6.9.1"
1301 msgstr "Linux man-pages 6.9.1"
1302
1303 #. type: Plain text
1304 #: debian-trixie
1305 msgid "Standard C library (I<libc>, I<-lc>)"
1306 msgstr "Biblioteca C Padrão (I<libc>, I<-lc>)"
1307
1308 #. type: Plain text
1309 #: debian-trixie
1310 msgid ""
1311 "A pointer to the socket address is placed in the I<ai_addr> field, and the "
1312 "length of the socket address, in bytes, is placed in the I<ai_addrlen> field."
1313 msgstr ""
1314
1315 #. type: Plain text
1316 #: debian-trixie fedora-44 fedora-rawhide
1317 #, no-wrap
1318 msgid ""
1319 "#include E<lt>netdb.hE<gt>\n"
1320 "#include E<lt>stdio.hE<gt>\n"
1321 "#include E<lt>stdlib.hE<gt>\n"
1322 "#include E<lt>string.hE<gt>\n"
1323 "#include E<lt>sys/socket.hE<gt>\n"
1324 "#include E<lt>sys/types.hE<gt>\n"
1325 "#include E<lt>unistd.hE<gt>\n"
1326 "\\&\n"
1327 "#define BUF_SIZE 500\n"
1328 "\\&\n"
1329 "int\n"
1330 "main(int argc, char *argv[])\n"
1331 "{\n"
1332 " int sfd, s;\n"
1333 " char buf[BUF_SIZE];\n"
1334 " ssize_t nread;\n"
1335 " socklen_t peer_addrlen;\n"
1336 " struct addrinfo hints;\n"
1337 " struct addrinfo *result, *rp;\n"
1338 " struct sockaddr_storage peer_addr;\n"
1339 "\\&\n"
1340 " if (argc != 2) {\n"
1341 " fprintf(stderr, \"Usage: %s port\\[rs]n\", argv[0]);\n"
1342 " exit(EXIT_FAILURE);\n"
1343 " }\n"
1344 "\\&\n"
1345 " memset(&hints, 0, sizeof(hints));\n"
1346 " hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */\n"
1347 " hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */\n"
1348 " hints.ai_flags = AI_PASSIVE; /* For wildcard IP address */\n"
1349 " hints.ai_protocol = 0; /* Any protocol */\n"
1350 " hints.ai_canonname = NULL;\n"
1351 " hints.ai_addr = NULL;\n"
1352 " hints.ai_next = NULL;\n"
1353 "\\&\n"
1354 " s = getaddrinfo(NULL, argv[1], &hints, &result);\n"
1355 " if (s != 0) {\n"
1356 " fprintf(stderr, \"getaddrinfo: %s\\[rs]n\", gai_strerror(s));\n"
1357 " exit(EXIT_FAILURE);\n"
1358 " }\n"
1359 "\\&\n"
1360 " /* getaddrinfo() returns a list of address structures.\n"
1361 " Try each address until we successfully bind(2).\n"
1362 " If socket(2) (or bind(2)) fails, we (close the socket\n"
1363 " and) try the next address. */\n"
1364 "\\&\n"
1365 " for (rp = result; rp != NULL; rp = rp-E<gt>ai_next) {\n"
1366 " sfd = socket(rp-E<gt>ai_family, rp-E<gt>ai_socktype,\n"
1367 " rp-E<gt>ai_protocol);\n"
1368 " if (sfd == -1)\n"
1369 " continue;\n"
1370 "\\&\n"
1371 " if (bind(sfd, rp-E<gt>ai_addr, rp-E<gt>ai_addrlen) == 0)\n"
1372 " break; /* Success */\n"
1373 "\\&\n"
1374 " close(sfd);\n"
1375 " }\n"
1376 "\\&\n"
1377 " freeaddrinfo(result); /* No longer needed */\n"
1378 "\\&\n"
1379 " if (rp == NULL) { /* No address succeeded */\n"
1380 " fprintf(stderr, \"Could not bind\\[rs]n\");\n"
1381 " exit(EXIT_FAILURE);\n"
1382 " }\n"
1383 "\\&\n"
1384 " /* Read datagrams and echo them back to sender. */\n"
1385 "\\&\n"
1386 " for (;;) {\n"
1387 " char host[NI_MAXHOST], service[NI_MAXSERV];\n"
1388 "\\&\n"
1389 " peer_addrlen = sizeof(peer_addr);\n"
1390 " nread = recvfrom(sfd, buf, BUF_SIZE, 0,\n"
1391 " (struct sockaddr *) &peer_addr, &peer_addrlen);\n"
1392 " if (nread == -1)\n"
1393 " continue; /* Ignore failed request */\n"
1394 "\\&\n"
1395 " s = getnameinfo((struct sockaddr *) &peer_addr,\n"
1396 " peer_addrlen, host, NI_MAXHOST,\n"
1397 " service, NI_MAXSERV, NI_NUMERICSERV);\n"
1398 " if (s == 0)\n"
1399 " printf(\"Received %zd bytes from %s:%s\\[rs]n\",\n"
1400 " nread, host, service);\n"
1401 " else\n"
1402 " fprintf(stderr, \"getnameinfo: %s\\[rs]n\", gai_strerror(s));\n"
1403 "\\&\n"
1404 " if (sendto(sfd, buf, nread, 0, (struct sockaddr *) &peer_addr,\n"
1405 " peer_addrlen) != nread)\n"
1406 " {\n"
1407 " fprintf(stderr, \"Error sending response\\[rs]n\");\n"
1408 " }\n"
1409 " }\n"
1410 "}\n"
1411 msgstr ""
1412
1413 #. type: Plain text
1414 #: debian-trixie
1415 #, no-wrap
1416 msgid ""
1417 "#include E<lt>netdb.hE<gt>\n"
1418 "#include E<lt>stdio.hE<gt>\n"
1419 "#include E<lt>stdlib.hE<gt>\n"
1420 "#include E<lt>string.hE<gt>\n"
1421 "#include E<lt>sys/socket.hE<gt>\n"
1422 "#include E<lt>sys/types.hE<gt>\n"
1423 "#include E<lt>unistd.hE<gt>\n"
1424 "\\&\n"
1425 "#define BUF_SIZE 500\n"
1426 "\\&\n"
1427 "int\n"
1428 "main(int argc, char *argv[])\n"
1429 "{\n"
1430 " int sfd, s;\n"
1431 " char buf[BUF_SIZE];\n"
1432 " size_t len;\n"
1433 " ssize_t nread;\n"
1434 " struct addrinfo hints;\n"
1435 " struct addrinfo *result, *rp;\n"
1436 "\\&\n"
1437 " if (argc E<lt> 3) {\n"
1438 " fprintf(stderr, \"Usage: %s host port msg...\\[rs]n\", argv[0]);\n"
1439 " exit(EXIT_FAILURE);\n"
1440 " }\n"
1441 "\\&\n"
1442 " /* Obtain address(es) matching host/port. */\n"
1443 "\\&\n"
1444 " memset(&hints, 0, sizeof(hints));\n"
1445 " hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */\n"
1446 " hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */\n"
1447 " hints.ai_flags = 0;\n"
1448 " hints.ai_protocol = 0; /* Any protocol */\n"
1449 "\\&\n"
1450 " s = getaddrinfo(argv[1], argv[2], &hints, &result);\n"
1451 " if (s != 0) {\n"
1452 " fprintf(stderr, \"getaddrinfo: %s\\[rs]n\", gai_strerror(s));\n"
1453 " exit(EXIT_FAILURE);\n"
1454 " }\n"
1455 "\\&\n"
1456 " /* getaddrinfo() returns a list of address structures.\n"
1457 " Try each address until we successfully connect(2).\n"
1458 " If socket(2) (or connect(2)) fails, we (close the socket\n"
1459 " and) try the next address. */\n"
1460 "\\&\n"
1461 " for (rp = result; rp != NULL; rp = rp-E<gt>ai_next) {\n"
1462 " sfd = socket(rp-E<gt>ai_family, rp-E<gt>ai_socktype,\n"
1463 " rp-E<gt>ai_protocol);\n"
1464 " if (sfd == -1)\n"
1465 " continue;\n"
1466 "\\&\n"
1467 " if (connect(sfd, rp-E<gt>ai_addr, rp-E<gt>ai_addrlen) != -1)\n"
1468 " break; /* Success */\n"
1469 "\\&\n"
1470 " close(sfd);\n"
1471 " }\n"
1472 "\\&\n"
1473 " freeaddrinfo(result); /* No longer needed */\n"
1474 "\\&\n"
1475 " if (rp == NULL) { /* No address succeeded */\n"
1476 " fprintf(stderr, \"Could not connect\\[rs]n\");\n"
1477 " exit(EXIT_FAILURE);\n"
1478 " }\n"
1479 "\\&\n"
1480 " /* Send remaining command-line arguments as separate\n"
1481 " datagrams, and read responses from server. */\n"
1482 "\\&\n"
1483 " for (size_t j = 3; j E<lt> argc; j++) {\n"
1484 " len = strlen(argv[j]) + 1;\n"
1485 " /* +1 for terminating null byte */\n"
1486 "\\&\n"
1487 " if (len E<gt> BUF_SIZE) {\n"
1488 " fprintf(stderr,\n"
1489 " \"Ignoring long message in argument %zu\\[rs]n\", j);\n"
1490 " continue;\n"
1491 " }\n"
1492 "\\&\n"
1493 " if (write(sfd, argv[j], len) != len) {\n"
1494 " fprintf(stderr, \"partial/failed write\\[rs]n\");\n"
1495 " exit(EXIT_FAILURE);\n"
1496 " }\n"
1497 "\\&\n"
1498 " nread = read(sfd, buf, BUF_SIZE);\n"
1499 " if (nread == -1) {\n"
1500 " perror(\"read\");\n"
1501 " exit(EXIT_FAILURE);\n"
1502 " }\n"
1503 "\\&\n"
1504 " printf(\"Received %zd bytes: %s\\[rs]n\", nread, buf);\n"
1505 " }\n"
1506 "\\&\n"
1507 " exit(EXIT_SUCCESS);\n"
1508 "}\n"
1509 msgstr ""
1510
1511 #. type: TH
1512 #: fedora-44 fedora-rawhide
1513 #, no-wrap
1514 msgid "2024-11-17"
1515 msgstr "17 novembro 2024"
1516
1517 #. type: TH
1518 #: fedora-44 fedora-rawhide
1519 #, no-wrap
1520 msgid "Linux man-pages 6.13"
1521 msgstr "Linux man-pages 6.13"
1522
1523 #. type: Plain text
1524 #: fedora-44 fedora-rawhide
1525 #, no-wrap
1526 msgid ""
1527 "#include E<lt>netdb.hE<gt>\n"
1528 "#include E<lt>stdio.hE<gt>\n"
1529 "#include E<lt>stdlib.hE<gt>\n"
1530 "#include E<lt>string.hE<gt>\n"
1531 "#include E<lt>sys/socket.hE<gt>\n"
1532 "#include E<lt>sys/types.hE<gt>\n"
1533 "#include E<lt>unistd.hE<gt>\n"
1534 "\\&\n"
1535 "#define BUF_SIZE 500\n"
1536 "\\&\n"
1537 "int\n"
1538 "main(int argc, char *argv[])\n"
1539 "{\n"
1540 " int sfd, s;\n"
1541 " char buf[BUF_SIZE];\n"
1542 " size_t size;\n"
1543 " ssize_t nread;\n"
1544 " struct addrinfo hints;\n"
1545 " struct addrinfo *result, *rp;\n"
1546 "\\&\n"
1547 " if (argc E<lt> 3) {\n"
1548 " fprintf(stderr, \"Usage: %s host port msg...\\[rs]n\", argv[0]);\n"
1549 " exit(EXIT_FAILURE);\n"
1550 " }\n"
1551 "\\&\n"
1552 " /* Obtain address(es) matching host/port. */\n"
1553 "\\&\n"
1554 " memset(&hints, 0, sizeof(hints));\n"
1555 " hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */\n"
1556 " hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */\n"
1557 " hints.ai_flags = 0;\n"
1558 " hints.ai_protocol = 0; /* Any protocol */\n"
1559 "\\&\n"
1560 " s = getaddrinfo(argv[1], argv[2], &hints, &result);\n"
1561 " if (s != 0) {\n"
1562 " fprintf(stderr, \"getaddrinfo: %s\\[rs]n\", gai_strerror(s));\n"
1563 " exit(EXIT_FAILURE);\n"
1564 " }\n"
1565 "\\&\n"
1566 " /* getaddrinfo() returns a list of address structures.\n"
1567 " Try each address until we successfully connect(2).\n"
1568 " If socket(2) (or connect(2)) fails, we (close the socket\n"
1569 " and) try the next address. */\n"
1570 "\\&\n"
1571 " for (rp = result; rp != NULL; rp = rp-E<gt>ai_next) {\n"
1572 " sfd = socket(rp-E<gt>ai_family, rp-E<gt>ai_socktype,\n"
1573 " rp-E<gt>ai_protocol);\n"
1574 " if (sfd == -1)\n"
1575 " continue;\n"
1576 "\\&\n"
1577 " if (connect(sfd, rp-E<gt>ai_addr, rp-E<gt>ai_addrlen) != -1)\n"
1578 " break; /* Success */\n"
1579 "\\&\n"
1580 " close(sfd);\n"
1581 " }\n"
1582 "\\&\n"
1583 " freeaddrinfo(result); /* No longer needed */\n"
1584 "\\&\n"
1585 " if (rp == NULL) { /* No address succeeded */\n"
1586 " fprintf(stderr, \"Could not connect\\[rs]n\");\n"
1587 " exit(EXIT_FAILURE);\n"
1588 " }\n"
1589 "\\&\n"
1590 " /* Send remaining command-line arguments as separate\n"
1591 " datagrams, and read responses from server. */\n"
1592 "\\&\n"
1593 " for (size_t j = 3; j E<lt> argc; j++) {\n"
1594 " size = strlen(argv[j]) + 1;\n"
1595 " /* +1 for terminating null byte */\n"
1596 "\\&\n"
1597 " if (size E<gt> BUF_SIZE) {\n"
1598 " fprintf(stderr,\n"
1599 " \"Ignoring long message in argument %zu\\[rs]n\", j);\n"
1600 " continue;\n"
1601 " }\n"
1602 "\\&\n"
1603 " if (write(sfd, argv[j], size) != size) {\n"
1604 " fprintf(stderr, \"partial/failed write\\[rs]n\");\n"
1605 " exit(EXIT_FAILURE);\n"
1606 " }\n"
1607 "\\&\n"
1608 " nread = read(sfd, buf, BUF_SIZE);\n"
1609 " if (nread == -1) {\n"
1610 " perror(\"read\");\n"
1611 " exit(EXIT_FAILURE);\n"
1612 " }\n"
1613 "\\&\n"
1614 " printf(\"Received %zd bytes: %s\\[rs]n\", nread, buf);\n"
1615 " }\n"
1616 "\\&\n"
1617 " exit(EXIT_SUCCESS);\n"
1618 "}\n"
1619 msgstr ""
1620
1621 #. type: TH
1622 #: mageia-cauldron
1623 #, no-wrap
1624 msgid "Linux man-pages 6.17"
1625 msgstr "Linux man-pages 6.17"
1626
1627 #. type: TH
1628 #: opensuse-leap-16-1 opensuse-tumbleweed
1629 #, no-wrap
1630 msgid "Linux man-pages (unreleased)"
1631 msgstr "Linux man-pages (não lançado)"
1632
1633 #. .BR getipnodebyaddr (3),
1634 #. .BR getipnodebyname (3),
1635 #. type: Plain text
1636 #: opensuse-leap-16-1 opensuse-tumbleweed
1637 msgid ""
1638 "B<getaddrinfo_a>(3), B<gethostbyname>(3), B<getnameinfo>(3), B<gai.conf>(5), "
1639 "B<inet>(3), B<gai.conf>(5), B<hostname>(7), B<ip>(7)"
1640 msgstr ""
1641 "B<getaddrinfo_a>(3), B<gethostbyname>(3), B<getnameinfo>(3), B<gai.conf>(5), "
1642 "B<inet>(3), B<gai.conf>(5), B<hostname>(7), B<ip>(7)"