Debian Codegraph @

po/pl/man3/getaddrinfo.3.po

raw
1 # Polish translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Andrzej Krzysztofowicz <[email protected]>, 2001.
5 # Michał Kułach <[email protected]>, 2024, 2025.
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: 2025-11-30 12:15+0100\n"
11 "Last-Translator: Michał Kułach <[email protected]>\n"
12 "Language-Team: Polish <[email protected]>\n"
13 "Language: pl\n"
14 "MIME-Version: 1.0\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
17 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18 "X-Generator: Lokalize 25.04.0\n"
19
20 #. type: TH
21 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
22 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
23 #, no-wrap
24 msgid "getaddrinfo"
25 msgstr "getaddrinfo"
26
27 #. type: TH
28 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
29 #: opensuse-tumbleweed
30 #, no-wrap
31 msgid "2026-02-08"
32 msgstr "8 lutego 2026 r."
33
34 #. type: TH
35 #: archlinux debian-unstable
36 #, no-wrap
37 msgid "Linux man-pages 6.18"
38 msgstr "Linux man-pages 6.18"
39
40 #. type: SH
41 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
42 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
43 #, no-wrap
44 msgid "NAME"
45 msgstr "NAZWA"
46
47 #. type: Plain text
48 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
49 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
50 msgid ""
51 "getaddrinfo, freeaddrinfo, gai_strerror - network address and service "
52 "translation"
53 msgstr ""
54 "getaddrinfo, freeaddrinfo, gai_strerror - tłumaczy adresy i usługi sieciowe"
55
56 #. type: SH
57 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
58 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
59 #, no-wrap
60 msgid "LIBRARY"
61 msgstr "BIBLIOTEKA"
62
63 #. type: Plain text
64 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
65 #: opensuse-leap-16-1 opensuse-tumbleweed
66 msgid "Standard C library (I<libc>,\\ I<-lc>)"
67 msgstr "Standardowa biblioteka C (I<libc>,\\ I<-lc>)"
68
69 #. type: SH
70 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
71 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
72 #, no-wrap
73 msgid "SYNOPSIS"
74 msgstr "SKŁADNIA"
75
76 #. type: Plain text
77 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
78 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
79 #, no-wrap
80 msgid ""
81 "B<#include E<lt>sys/types.hE<gt>>\n"
82 "B<#include E<lt>sys/socket.hE<gt>>\n"
83 "B<#include E<lt>netdb.hE<gt>>\n"
84 msgstr ""
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
89 #. type: Plain text
90 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
91 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
92 #, no-wrap
93 msgid ""
94 "B<int getaddrinfo(const char *restrict >I<node>B<,>\n"
95 "B< const char *restrict >I<service>B<,>\n"
96 "B< const struct addrinfo *restrict >I<hints>B<,>\n"
97 "B< struct addrinfo **restrict >I<res>B<);>\n"
98 msgstr ""
99 "B<int getaddrinfo(const char *restrict >I<node>B<,>\n"
100 "B< const char *restrict >I<service>B<,>\n"
101 "B< const struct addrinfo *restrict >I<hints>B<,>\n"
102 "B< struct addrinfo **restrict >I<res>B<);>\n"
103
104 #. type: Plain text
105 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
106 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
107 #, no-wrap
108 msgid "B<void freeaddrinfo(struct addrinfo *>I<res>B<);>\n"
109 msgstr "B<void freeaddrinfo(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<const char *gai_strerror(int >I<errcode>B<);>\n"
116 msgstr "B<const char *gai_strerror(int >I<errcode>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 msgid ""
122 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
123 msgstr ""
124 "Wymagane ustawienia makr biblioteki glibc (patrz B<feature_test_macros>(7)):"
125
126 #. type: Plain text
127 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
128 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
129 msgid "B<getaddrinfo>(), B<freeaddrinfo>(), B<gai_strerror>():"
130 msgstr "B<getaddrinfo>(), B<freeaddrinfo>(), B<gai_strerror>():"
131
132 #. type: Plain text
133 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
134 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
135 #, no-wrap
136 msgid ""
137 " Since glibc 2.22:\n"
138 " _POSIX_C_SOURCE E<gt>= 200112L\n"
139 " glibc 2.21 and earlier:\n"
140 " _POSIX_C_SOURCE\n"
141 msgstr ""
142 " Od glibc 2.22:\n"
143 " _POSIX_C_SOURCE E<gt>= 200112L\n"
144 " glibc 2.21 i wcześniejsze:\n"
145 " _POSIX_C_SOURCE\n"
146
147 #. type: SH
148 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
149 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
150 #, no-wrap
151 msgid "DESCRIPTION"
152 msgstr "OPIS"
153
154 #. .BR getipnodebyname (3),
155 #. .BR getipnodebyaddr (3),
156 #. type: Plain text
157 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
158 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
159 msgid ""
160 "Given I<node> and I<service>, which identify an Internet host and a service, "
161 "B<getaddrinfo>() returns one or more I<addrinfo> structures, each of which "
162 "contains an Internet address that can be specified in a call to B<bind>(2) "
163 "or B<connect>(2). The B<getaddrinfo>() function combines the functionality "
164 "provided by the B<gethostbyname>(3) and B<getservbyname>(3) functions into "
165 "a single interface, but unlike the latter functions, B<getaddrinfo>() is "
166 "reentrant and allows programs to eliminate IPv4-versus-IPv6 dependencies."
167 msgstr ""
168 "Dla danego węzła I<node> i usługi I<service>, które identyfikują stację i "
169 "usługę internetową, B<getaddrinfo>() zwraca jedną lub więcej struktur "
170 "I<addrinfo>, każda z których zawiera adres internetowy, który można podać w "
171 "wywołaniu do B<bind>(2) lub B<connect>(2). Funkcja B<getaddrinfo>() łączy "
172 "funkcjonalność udostępnianą przez funkcje B<gethostbyname>(3) i "
173 "B<getservbyname>(3) w jeden interfejs, lecz w przeciwieństwie do nich, "
174 "B<getaddrinfo>() jest wielobieżna i umożliwia programom wyeliminowanie "
175 "zależności od IPv4 lub IPv6."
176
177 #. type: Plain text
178 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
179 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
180 msgid ""
181 "The I<addrinfo> structure used by B<getaddrinfo>() contains the following "
182 "fields:"
183 msgstr ""
184 "Struktura I<addrinfo> używana przez B<getaddrinfo>() zawiera następujące "
185 "pola:"
186
187 #. type: Plain text
188 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
189 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
190 #, no-wrap
191 msgid ""
192 "struct addrinfo {\n"
193 " int ai_flags;\n"
194 " int ai_family;\n"
195 " int ai_socktype;\n"
196 " int ai_protocol;\n"
197 " socklen_t ai_addrlen;\n"
198 " struct sockaddr *ai_addr;\n"
199 " char *ai_canonname;\n"
200 " struct addrinfo *ai_next;\n"
201 "};\n"
202 msgstr ""
203 "struct addrinfo {\n"
204 " int ai_flags;\n"
205 " int ai_family;\n"
206 " int ai_socktype;\n"
207 " int ai_protocol;\n"
208 " socklen_t ai_addrlen;\n"
209 " struct sockaddr *ai_addr;\n"
210 " char *ai_canonname;\n"
211 " struct addrinfo *ai_next;\n"
212 "};\n"
213
214 #. type: Plain text
215 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
216 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
217 msgid ""
218 "The I<hints> argument points to an I<addrinfo> structure that specifies "
219 "criteria for selecting the socket address structures returned in the list "
220 "pointed to by I<res>. If I<hints> is not NULL it points to an I<addrinfo> "
221 "structure whose I<ai_family>, I<ai_socktype>, and I<ai_protocol> specify "
222 "criteria that limit the set of socket addresses returned by "
223 "B<getaddrinfo>(), as follows:"
224 msgstr ""
225 "Argument I<hints> wskazuje na strukturę I<addrinfo>, która określa kryteria "
226 "wyboru struktur adresów gniazd zwracanych w liście wskazywanej przez I<res>. "
227 "Jeśli I<hints> nie wynosi NULL, wskazuje na strukturę I<addrinfo>, której "
228 "pola I<ai_family>, I<ai_socktype> i I<ai_protocol> określają kryteria "
229 "ograniczające zbiory adresów gniazd zwracane przez B<getaddrinfo>(), zgodnie "
230 "z poniższym opisem:"
231
232 #. type: TP
233 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
234 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
235 #, no-wrap
236 msgid "I<ai_family>"
237 msgstr "I<ai_family>"
238
239 #. type: Plain text
240 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
241 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
242 msgid ""
243 "This field specifies the desired address family for the returned addresses. "
244 "Valid values for this field include B<AF_INET> and B<AF_INET6>. The value "
245 "B<AF_UNSPEC> indicates that B<getaddrinfo>() should return socket addresses "
246 "for any address family (either IPv4 or IPv6, for example) that can be used "
247 "with I<node> and I<service>."
248 msgstr ""
249 "Pole określa żądaną rodzinę adresów wobec zwracanych adresów. Prawidłowe "
250 "wartości tego pola obejmują B<AF_INET> i B<AF_INET6>. Wartość B<AF_UNSPEC> "
251 "wskazuje, że B<getaddrinfo>() powinno zwrócić adresy gniazd dla dowolnej "
252 "rodziny adresów (np. IPv4 lub IPv6), których można użyć z I<node> i "
253 "I<service>."
254
255 #. type: TP
256 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
257 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
258 #, no-wrap
259 msgid "I<ai_socktype>"
260 msgstr "I<ai_socktype>"
261
262 #. type: Plain text
263 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
264 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
265 msgid ""
266 "This field specifies the preferred socket type, for example B<SOCK_STREAM> "
267 "or B<SOCK_DGRAM>. Specifying 0 in this field indicates that socket "
268 "addresses of any type can be returned by B<getaddrinfo>()."
269 msgstr ""
270 "Pole określa preferowany typ gniazda np. B<SOCK_STREAM> lub B<SOCK_DGRAM>. "
271 "Podanie w tym polu wartości 0 wskazuje, że B<getaddrinfo>() może zwrócić "
272 "adresy gniazd dowolnego typu."
273
274 #. type: TP
275 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
276 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
277 #, no-wrap
278 msgid "I<ai_protocol>"
279 msgstr "I<ai_protocol>"
280
281 #. type: Plain text
282 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
283 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
284 msgid ""
285 "This field specifies the protocol for the returned socket addresses. "
286 "Specifying 0 in this field indicates that socket addresses with any protocol "
287 "can be returned by B<getaddrinfo>()."
288 msgstr ""
289 "Pole określa protokół zwracanych adresów gniazd. Podanie w tym polu wartości "
290 "0 wskazuje, że B<getaddrinfo>() może zwrócić adresy gniazd dowolnego "
291 "protokołu."
292
293 #. type: TP
294 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
295 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
296 #, no-wrap
297 msgid "I<ai_flags>"
298 msgstr "I<ai_flags>"
299
300 #. type: Plain text
301 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
302 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
303 msgid ""
304 "This field specifies additional options, described below. Multiple flags "
305 "are specified by bitwise OR-ing them together."
306 msgstr ""
307 "Pole określa dodatkowe opcje, opisane poniżej. Można podać wiele flag, "
308 "sumując je bitowo (OR)."
309
310 #. type: Plain text
311 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
312 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
313 msgid ""
314 "All the other fields in the structure pointed to by I<hints> must contain "
315 "either 0 or a null pointer, as appropriate."
316 msgstr ""
317 "Wszystkie pozostałe pola w strukturze na którą wskazuje I<hints>, muszą "
318 "zawierać albo 0, albo pusty wskaźnik (w zależności od pola)."
319
320 #. type: Plain text
321 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
322 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
323 msgid ""
324 "Specifying I<hints> as NULL is equivalent to setting I<ai_socktype> and "
325 "I<ai_protocol> to 0; I<ai_family> to B<AF_UNSPEC>; and I<ai_flags> to "
326 "B<(AI_V4MAPPED\\ |\\ AI_ADDRCONFIG)>. (POSIX specifies different defaults "
327 "for I<ai_flags>; see NOTES.) I<node> specifies either a numerical network "
328 "address (for IPv4, numbers-and-dots notation as supported by "
329 "B<inet_aton>(3); for IPv6, hexadecimal string format as supported by "
330 "B<inet_pton>(3)), or a network hostname, whose network addresses are looked "
331 "up and resolved. If I<hints.ai_flags> contains the B<AI_NUMERICHOST> flag, "
332 "then I<node> must be a numerical network address. The B<AI_NUMERICHOST> "
333 "flag suppresses any potentially lengthy network host address lookups."
334 msgstr ""
335 "Podanie I<hints> jako NULL jest równoważne ustawieniu I<ai_socktype> i "
336 "I<ai_protocol> na 0; I<ai_family> na B<AF_UNSPEC>; a I<ai_flags> na "
337 "B<(AI_V4MAPPED\\ |\\ AI_ADDRCONFIG)> (POSIX określa inną wartość domyślną "
338 "dla I<ai_flags>; zob. UWAGI). I<node> zawiera albo adres sieciowy w postaci "
339 "numerycznej (dla IPv4: w formacie liczb i kropek takim, jak obsługiwany "
340 "przez B<inet_aton>(3); dla IPv6: w formacie szesnastkowego łańcucha takim, "
341 "jak obsługiwany przez B<init_pton>(3)), albo nazwę stacji, dla której adresy "
342 "sieciowe będą poszukiwane i rozwiązane. Jeśli I<hints.ai_flags> zawiera "
343 "znacznik B<AI_NUMERICHOST>, to I<node> musi być adresem sieciowym w postaci "
344 "numerycznej. Znacznik B<AI_NUMERICHOST> eliminuje jakiekolwiek, potencjalnie "
345 "długotrwałe, poszukiwania adresu sieciowego stacji."
346
347 #. type: Plain text
348 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
349 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
350 msgid ""
351 "If the B<AI_PASSIVE> flag is specified in I<hints.ai_flags>, and I<node> is "
352 "NULL, then the returned socket addresses will be suitable for B<bind>(2)ing "
353 "a socket that will B<accept>(2) connections. The returned socket address "
354 "will contain the \"wildcard address\" (B<INADDR_ANY> for IPv4 addresses, "
355 "B<IN6ADDR_ANY_INIT> for IPv6 address). The wildcard address is used by "
356 "applications (typically servers) that intend to accept connections on any "
357 "of the host's network addresses. If I<node> is not NULL, then the "
358 "B<AI_PASSIVE> flag is ignored."
359 msgstr ""
360 "Jeśli w I<hints.ai_flags> podano znacznik B<AI_PASSIVE>, a I<node> wynosi "
361 "NULL, to zwracane adresy gniazd będą odpowiednie do przypisywania "
362 "(B<bind>(2)) gniazd, które będą akceptowały (B<accept>(2)) połączenia. "
363 "Zwracany adres gniazda będzie zawierał \\[Bq]adres wieloznaczny\\[rq] (\\"
364 "[Bq]wildcard address\\[rq]; B<INADDR_ANY> w przypadku adresów IPv4, "
365 "B<IN6ADDR_ANY_INIT> w przypadku adresów IPv6). Adres wieloznaczny jest "
366 "używany przez aplikacje (zwykle serwery), które mają zamiar akceptować "
367 "połączenia na dowolnym z adresów sieciowych stacji. Jeśli I<node> nie wynosi "
368 "NULL, to znacznik B<AI_PASSIVE> jest ignorowany."
369
370 #. type: Plain text
371 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
372 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
373 msgid ""
374 "If the B<AI_PASSIVE> flag is not set in I<hints.ai_flags>, then the returned "
375 "socket addresses will be suitable for use with B<connect>(2), B<sendto>(2), "
376 "or B<sendmsg>(2). If I<node> is NULL, then the network address will be set "
377 "to the loopback interface address (B<INADDR_LOOPBACK> for IPv4 addresses, "
378 "B<IN6ADDR_LOOPBACK_INIT> for IPv6 address); this is used by applications "
379 "that intend to communicate with peers running on the same host."
380 msgstr ""
381 "Jeśli w I<hints.ai_flags> nie podano znacznika B<AI_PASSIVE>, to zwracane "
382 "adresy gniazd będą odpowiednie do korzystania z B<connect>(2), B<sendto>(2) "
383 "lub B<sendmsg>(2). Jeśli I<node> wynosi NULL, to adres sieciowy będzie "
384 "ustawiony na adres interfejsu pętli zwrotnej (B<INADDR_LOOPBACK> w przypadku "
385 "adresów IPv4, B<IN6ADDR_LOOPBACK_INIT> w przypadku adresów IPv6); jest to "
386 "używane przez aplikacje, które mają zamiar komunikować się z innymi "
387 "aplikacjami działającymi na tej samej stacji."
388
389 #. type: Plain text
390 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
391 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
392 msgid ""
393 "I<service> sets the port in each returned address structure. If this "
394 "argument is a service name (see B<services>(5)), it is translated to the "
395 "corresponding port number. This argument can also be specified as a decimal "
396 "number, which is simply converted to binary. If I<service> is NULL, then "
397 "the port number of the returned socket addresses will be left "
398 "uninitialized. If B<AI_NUMERICSERV> is specified in I<hints.ai_flags> and "
399 "I<service> is not NULL, then I<service> must point to a string containing a "
400 "numeric port number. This flag is used to inhibit the invocation of a name "
401 "resolution service in cases where it is known not to be required."
402 msgstr ""
403 "I<service> ustawia port w każdej zwracanej strukturze adresu. Jeśli argument "
404 "ten jest nazwą usługi (zob. B<services>(5)), to jest tłumaczona na "
405 "odpowiedni numer portu. Argument ten może być też liczbą dziesiętną, wówczas "
406 "jest jedynie przekształcana na liczbę binarną. Jeśli I<service> wynosi NULL, "
407 "to numer portu zwracanych adresów gniazd będzie pozostawiony "
408 "niezainicjowany. Jeśli w I<hints.ai_flags> podano B<AI_NUMERICSERV>, a "
409 "I<service> nie wynosi NULL, to I<service> musi wskazywać na łańcuch "
410 "zawierający numeryczny numer portu. Znacznik ten jest używany do "
411 "powstrzymania rozwiązywania nazw w przypadkach, w których wiadomo, że nie "
412 "będzie to konieczne."
413
414 #. type: Plain text
415 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
416 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
417 msgid "Either I<node> or I<service>, but not both, may be NULL."
418 msgstr "Parametry I<node> i I<service> mogą być równe NULL, ale nie oba naraz."
419
420 #. type: Plain text
421 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
422 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
423 msgid ""
424 "The B<getaddrinfo>() function allocates and initializes a linked list of "
425 "I<addrinfo> structures, one for each network address that matches I<node> "
426 "and I<service>, subject to any restrictions imposed by I<hints>, and returns "
427 "a pointer to the start of the list in I<res>. The items in the linked list "
428 "are linked by the I<ai_next> field."
429 msgstr ""
430 "Funkcja B<getaddrinfo>() alokuje i inicjuje podlinkowaną listę struktur "
431 "I<addrinfo>, po jednej dla każdego adresu sieciowego, który pasuje do "
432 "I<node> i I<service>, jest przedmiotem wszelkich ograniczeń nałożonych przez "
433 "I<hints>, a zwraca wskaźnik do początku listy w I<res>. Pozycje na "
434 "podlinkownej liście są linkowane za pomocą pola I<ai_next>."
435
436 #. type: Plain text
437 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
438 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
439 msgid ""
440 "There are several reasons why the linked list may have more than one "
441 "I<addrinfo> structure, including: the network host is multihomed, accessible "
442 "over multiple protocols (e.g., both B<AF_INET> and B<AF_INET6>); or the same "
443 "service is available from multiple socket types (one B<SOCK_STREAM> address "
444 "and another B<SOCK_DGRAM> address, for example). Normally, the application "
445 "should try using the addresses in the order in which they are returned. The "
446 "sorting function used within B<getaddrinfo>() is defined in RFC\\ 3484; the "
447 "order can be tweaked for a particular system by editing I</etc/gai.conf> "
448 "(available since glibc 2.5)."
449 msgstr ""
450 "Istnieje wiele powodów, dla których podlinkowana lista może mieć więcej niż "
451 "jedną strukturę I<addrinfo> m.in.: stacja sieciowa może być wieloadresowa, "
452 "dostępna za pomocą różnych protokołów (np. B<AF_INET> oraz B<AF_INET6>); "
453 "albo ta sama usługa jest dostępna za pomocą różnych typów gniazd (np. jeden "
454 "adres B<SOCK_STREAM> i inny adres B<SOCK_DGRAM>). Aplikacja zwykle spróbuje "
455 "użyć adresy w zwracanej kolejności. Funkcja sortowania używana w "
456 "B<getaddrinfo>() jest zdefiniowana w RFC\\ 3484; kolejność można dostosować "
457 "dla danego systemu, edytując plik I</etc/gai.conf> (dostępny od glibc 2.5)."
458
459 #. Prior to glibc 2.3.4, the ai_canonname of each addrinfo
460 #. structure was set pointing to the canonical name; that was
461 #. more than POSIX.1-2001 specified, or other implementations provided.
462 #. MTK, Aug 05
463 #. type: Plain text
464 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
465 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
466 msgid ""
467 "If I<hints.ai_flags> includes the B<AI_CANONNAME> flag, then the "
468 "I<ai_canonname> field of the first of the I<addrinfo> structures in the "
469 "returned list is set to point to the official name of the host."
470 msgstr ""
471 "Jeśli I<hints.ai_flags> zawiera znacznik B<AI_CANONNAME>, to pole "
472 "I<ai_canonname> w pierwszej ze struktur I<addrinfo> w zwracanej liście, jest "
473 "ustawiane na oficjalną nazwę stacji."
474
475 #. type: Plain text
476 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
477 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
478 msgid ""
479 "The remaining fields of each returned I<addrinfo> structure are initialized "
480 "as follows:"
481 msgstr ""
482 "Pozostałe pola w każdej ze zwracanych struktur I<addrinfo> są inicjowane w "
483 "następujący sposób:"
484
485 #. type: IP
486 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
487 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
488 #, no-wrap
489 msgid "\\[bu]"
490 msgstr "\\[bu]"
491
492 #. type: Plain text
493 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
494 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
495 msgid ""
496 "The I<ai_family>, I<ai_socktype>, and I<ai_protocol> fields return the "
497 "socket creation parameters (i.e., these fields have the same meaning as the "
498 "corresponding arguments of B<socket>(2)). For example, I<ai_family> might "
499 "return B<AF_INET> or B<AF_INET6>; I<ai_socktype> might return B<SOCK_DGRAM> "
500 "or B<SOCK_STREAM>; and I<ai_protocol> returns the protocol for the socket."
501 msgstr ""
502 "Pola I<ai_family>, I<ai_socktype> i I<ai_protocol> zwracają parametry "
503 "tworzenia gniazd (tzn. pola te mają takie samo znaczenie, jak odpowiadające "
504 "im argumenty B<socket>(2)). Przykładowo I<ai_family> może zwrócić B<AF_INET> "
505 "lub B<AF_INET6>; I<ai_socktype> może zwrócić B<SOCK_DGRAM> lub "
506 "B<SOCK_STREAM>; a I<ai_protocol> zwróci protokół gniazda."
507
508 #. type: Plain text
509 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
510 #: opensuse-leap-16-1 opensuse-tumbleweed
511 msgid ""
512 "A pointer to the socket address is placed in the I<ai_addr> field, and the "
513 "size of the socket address, in bytes, is placed in the I<ai_addrlen> field."
514 msgstr ""
515 "Wskaźnik do adresu gniazda jest umieszczany w polu I<ai_addr>, a rozmiar "
516 "adresu gniazda w bajtach, jest umieszczana w polu I<ai_addrlen>."
517
518 #. type: Plain text
519 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
520 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
521 msgid ""
522 "If I<hints.ai_flags> includes the B<AI_ADDRCONFIG> flag, then IPv4 addresses "
523 "are returned in the list pointed to by I<res> only if the local system has "
524 "at least one IPv4 address configured, and IPv6 addresses are returned only "
525 "if the local system has at least one IPv6 address configured. The loopback "
526 "address is not considered for this case as valid as a configured address. "
527 "This flag is useful on, for example, IPv4-only systems, to ensure that "
528 "B<getaddrinfo>() does not return IPv6 socket addresses that would always "
529 "fail in B<connect>(2) or B<bind>(2)."
530 msgstr ""
531 "Jeśli I<hints.ai_flags> zawiera znacznik B<AI_ADDRCONFIG>, to adresy IPv4 są "
532 "zwracane w liście, na którą wskazuje I<res> tylko, gdy lokalny system ma "
533 "skonfigurowany przynajmniej jeden adres IPv4, a adresy IPv6 są zwracane "
534 "tylko, gdy lokalny system ma skonfigurowany przynajmniej jeden adres IPv6. "
535 "Adres pętli zwrotnej nie jest w tym przypadku uważany za prawidłowy "
536 "skonfigurowany adres. Znacznik ten jest przydatny np. w systemach "
537 "korzystających wyłącznie z IPv4 aby zapewnić, że B<getaddrinfo>() nie zwróci "
538 "adresów gniazd IPv6, które zawsze zawiodłyby w B<connect>(2) lub B<bind>(2)."
539
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 I<hints.ai_flags> specifies the B<AI_V4MAPPED> flag, and "
545 "I<hints.ai_family> was specified as B<AF_INET6>, and no matching IPv6 "
546 "addresses could be found, then return IPv4-mapped IPv6 addresses in the list "
547 "pointed to by I<res>. If both B<AI_V4MAPPED> and B<AI_ALL> are specified in "
548 "I<hints.ai_flags>, then return both IPv6 and IPv4-mapped IPv6 addresses in "
549 "the list pointed to by I<res>. B<AI_ALL> is ignored if B<AI_V4MAPPED> is "
550 "not also specified."
551 msgstr ""
552 "Jeśli I<hints.ai_flags> określa znacznik B<AI_V4MAPPED>, a "
553 "I<hints.ai_family> podano jako B<AF_INET6> oraz nie da się znaleźć "
554 "pasującego adresu IPv6, to w liście, na którą wskazuje I<res>, zwracane są "
555 "adresy IPv4 zmapowane jako IPv6. Jeśli w I<hints.ai_flags> podano "
556 "B<AI_V4MAPPED> oraz B<AI_ALL>, to zwracane są adresy IPv6 oraz adresy IPv4 "
557 "zmapowane jako IPv6. B<AI_ALL> jest ignorowane, jeśli nie podano również "
558 "B<AI_V4MAPPED>."
559
560 #. type: Plain text
561 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
562 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
563 msgid ""
564 "The B<freeaddrinfo>() function frees the memory that was allocated for the "
565 "dynamically allocated linked list I<res>."
566 msgstr ""
567 "Funkcja B<freeaddrinfo>() zwalnia pamięć przydzieloną dla dynamicznie "
568 "zaalokowanej listy I<res>."
569
570 #. type: SS
571 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
572 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
573 #, no-wrap
574 msgid "Extensions to getaddrinfo() for Internationalized Domain Names"
575 msgstr "Rozszerzenia getaddrinfo() dla domen ze znakami spoza ASCII (IDN)"
576
577 #. type: Plain text
578 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
579 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
580 msgid ""
581 "Starting with glibc 2.3.4, B<getaddrinfo>() has been extended to "
582 "selectively allow the incoming and outgoing hostnames to be transparently "
583 "converted to and from the Internationalized Domain Name (IDN) format (see "
584 "RFC 3490, I<Internationalizing Domain Names in Applications (IDNA)>). Four "
585 "new flags are defined:"
586 msgstr ""
587 "Od glibc 2.3.4, B<getaddrinfo>() rozszerzono w celu umożliwiania wybiórczego "
588 "i przezroczystego konwertowania przychodzących i wychodzących nazw stacji z "
589 "i na format Internationalized Domain Name (IDN; zob. RFC\\ 3490, "
590 "I<Internationalizing Domain Names in Applications (IDNA)>). Zdefiniowano "
591 "cztery nowe znaczniki:"
592
593 #. type: TP
594 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
595 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
596 #, no-wrap
597 msgid "B<AI_IDN>"
598 msgstr "B<AI_IDN>"
599
600 #. type: Plain text
601 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
602 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
603 msgid ""
604 "If this flag is specified, then the node name given in I<node> is converted "
605 "to IDN format if necessary. The source encoding is that of the current "
606 "locale."
607 msgstr ""
608 "Jeśli znacznik jest podany, nazwa węzła podana w I<node> jest konwertowana "
609 "na format IDN, jeśli to konieczne. Kodowanie źródłowe jest takie, jak w "
610 "bieżących ustawieniach regionalnych (locale)."
611
612 #. Implementation Detail:
613 #. To minimize effects on system performance the implementation might
614 #. want to check whether the input string contains any non-ASCII
615 #. characters. If there are none the IDN step can be skipped completely.
616 #. On systems which allow not-ASCII safe encodings for a locale this
617 #. might be a problem.
618 #. type: Plain text
619 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
620 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
621 msgid ""
622 "If the input name contains non-ASCII characters, then the IDN encoding is "
623 "used. Those parts of the node name (delimited by dots) that contain non-"
624 "ASCII characters are encoded using ASCII Compatible Encoding (ACE) before "
625 "being passed to the name resolution functions."
626 msgstr ""
627 "Jeśli nazwa wejściowa zawiera znaki spoza ASCII, to używane jest kodowanie "
628 "IDN. Te fragmenty nazwy węzła (oddzielone kropką), które zawierają znaki "
629 "spoza ASCII są kodowane za pomocą ASCII Compatible Encoding, przed ich "
630 "przekazaniem do funkcji rozwiązywania nazw."
631
632 #. type: TP
633 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
634 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
635 #, no-wrap
636 msgid "B<AI_CANONIDN>"
637 msgstr "B<AI_CANONIDN>"
638
639 #. type: Plain text
640 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
641 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
642 msgid ""
643 "After a successful name lookup, and if the B<AI_CANONNAME> flag was "
644 "specified, B<getaddrinfo>() will return the canonical name of the node "
645 "corresponding to the I<addrinfo> structure value passed back. The return "
646 "value is an exact copy of the value returned by the name resolution function."
647 msgstr ""
648 "Po pomyślnym wyszukaniu nazwy, jeśli podano B<AI_CANONNAME>, "
649 "B<getaddrinfo>() zwróci kanoniczną nazwę węzła odnoszącą się do wartości "
650 "struktury I<addrinfo> przekazywanej zwrotnie. Zwracana wartość jest dokładną "
651 "kopią wartości zwracanej przez funkcję rozwiązywania nazw."
652
653 #
654 #. Implementation Detail:
655 #. If no component of the returned name starts with xn\-\- the IDN
656 #. step can be skipped, therefore avoiding unnecessary slowdowns.
657 #. type: Plain text
658 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
659 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
660 msgid ""
661 "If the name is encoded using ACE, then it will contain the I<xn--> prefix "
662 "for one or more components of the name. To convert these components into a "
663 "readable form the B<AI_CANONIDN> flag can be passed in addition to "
664 "B<AI_CANONNAME>. The resulting string is encoded using the current locale's "
665 "encoding."
666 msgstr ""
667 "Jeśli nazwa jest zakodowana za pomocą ACE, to będzie zawierać przedrostek "
668 "I<xn--> w jednej lub więcej składowych nazw. Aby przekształcić te składowe w "
669 "czytelną postać, oprócz znacznika B<AI_CANONNAME> można podać też "
670 "B<AI_CANONIDN>. Wynikowy łańcuch będzie kodowany przy użyciu kodowania z "
671 "bieżących ustawieniach regionalnych (locale)."
672
673 #. type: TP
674 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
675 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
676 #, no-wrap
677 msgid "B<AI_IDN_ALLOW_UNASSIGNED>"
678 msgstr "B<AI_IDN_ALLOW_UNASSIGNED>"
679
680 #. type: TQ
681 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
682 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
683 #, no-wrap
684 msgid "B<AI_IDN_USE_STD3_ASCII_RULES>"
685 msgstr "B<AI_IDN_USE_STD3_ASCII_RULES>"
686
687 #. type: Plain text
688 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
689 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
690 msgid ""
691 "Setting these flags will enable the IDNA_ALLOW_UNASSIGNED (allow unassigned "
692 "Unicode code points) and IDNA_USE_STD3_ASCII_RULES (check output to make "
693 "sure it is a STD3 conforming hostname) flags respectively to be used in the "
694 "IDNA handling."
695 msgstr ""
696 "Ustawienie tych znaczników włączy znaczniki, odpowiednio, "
697 "IDNA_ALLOW_UNASSIGNED (zezwala na nieprzypisane kody Unikodu) i "
698 "IDNA_USE_STD3_ASCII_RULES (sprawdza wyjście, aby upewnić się że jest to "
699 "nazwa stacji zgodna z STD3) do użycia w obsłudze IDNA."
700
701 #. type: SH
702 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
703 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
704 #, no-wrap
705 msgid "RETURN VALUE"
706 msgstr "WARTOŚĆ ZWRACANA"
707
708 #. FIXME glibc defines the following additional errors, some which
709 #. can probably be returned by getaddrinfo(); they need to
710 #. be documented.
711 #. #ifdef __USE_GNU
712 #. #define EAI_INPROGRESS -100 /* Processing request in progress. */
713 #. #define EAI_CANCELED -101 /* Request canceled. */
714 #. #define EAI_NOTCANCELED -102 /* Request not canceled. */
715 #. #define EAI_ALLDONE -103 /* All requests done. */
716 #. #define EAI_INTR -104 /* Interrupted by a signal. */
717 #. #define EAI_IDN_ENCODE -105 /* IDN encoding failed. */
718 #. #endif
719 #. type: Plain text
720 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
721 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
722 msgid ""
723 "B<getaddrinfo>() returns 0 if it succeeds, or one of the following nonzero "
724 "error codes:"
725 msgstr ""
726 "B<getaddrinfo>() zwraca 0, gdy zakończy się pomyślnie, a w przeciwnym razie "
727 "jeden z następujących niezerowych kodów błędów:"
728
729 #. type: TP
730 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
731 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
732 #, no-wrap
733 msgid "B<EAI_ADDRFAMILY>"
734 msgstr "B<EAI_ADDRFAMILY>"
735
736 #. Not in SUSv3
737 #. type: Plain text
738 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
739 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
740 msgid ""
741 "The specified network host does not have any network addresses in the "
742 "requested address family."
743 msgstr ""
744 "Podana stacja nie posiada żadnego adresu sieciowego dla zadanej rodziny "
745 "adresów."
746
747 #. type: TP
748 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
749 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
750 #, no-wrap
751 msgid "B<EAI_AGAIN>"
752 msgstr "B<EAI_AGAIN>"
753
754 #. type: Plain text
755 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
756 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
757 msgid ""
758 "The name server returned a temporary failure indication. Try again later."
759 msgstr "Serwer nazw zwrócił błąd tymczasowy. Należy spróbować później."
760
761 #. type: TP
762 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
763 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
764 #, no-wrap
765 msgid "B<EAI_BADFLAGS>"
766 msgstr "B<EAI_BADFLAGS>"
767
768 #. type: Plain text
769 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
770 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
771 msgid ""
772 "I<hints.ai_flags> contains invalid flags; or, I<hints.ai_flags> included "
773 "B<AI_CANONNAME> and I<node> was NULL."
774 msgstr ""
775 "I<hints.ai_flags> zawiera nieprawidłowe znaczniki; lub I<hints.ai_flags> "
776 "zawierało B<AI_CANONNAME> i I<node> wynosiło NULL."
777
778 #. type: TP
779 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
780 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
781 #, no-wrap
782 msgid "B<EAI_FAIL>"
783 msgstr "B<EAI_FAIL>"
784
785 #. type: Plain text
786 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
787 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
788 msgid "The name server returned a permanent failure indication."
789 msgstr "Serwer nazw zwrócił błąd trwały."
790
791 #. type: TP
792 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
793 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
794 #, no-wrap
795 msgid "B<EAI_FAMILY>"
796 msgstr "B<EAI_FAMILY>"
797
798 #. type: Plain text
799 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
800 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
801 msgid "The requested address family is not supported."
802 msgstr "Żądana rodzina adresów nie jest obsługiwana."
803
804 #. type: TP
805 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
806 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
807 #, no-wrap
808 msgid "B<EAI_MEMORY>"
809 msgstr "B<EAI_MEMORY>"
810
811 #. type: Plain text
812 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
813 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
814 msgid "Out of memory."
815 msgstr "Brak pamięci."
816
817 #. type: TP
818 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
819 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
820 #, no-wrap
821 msgid "B<EAI_NODATA>"
822 msgstr "B<EAI_NODATA>"
823
824 #. Not in SUSv3
825 #. type: Plain text
826 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
827 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
828 msgid ""
829 "The specified network host exists, but does not have any network addresses "
830 "defined."
831 msgstr ""
832 "Podana stacja sieciowa istnieje, ale nie zdefiniowano dla niej żadnego "
833 "adresu sieciowego."
834
835 #. type: TP
836 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
837 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
838 #, no-wrap
839 msgid "B<EAI_NONAME>"
840 msgstr "B<EAI_NONAME>"
841
842 #. type: Plain text
843 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
844 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
845 msgid ""
846 "The I<node> or I<service> is not known; or both I<node> and I<service> are "
847 "NULL; or B<AI_NUMERICSERV> was specified in I<hints.ai_flags> and I<service> "
848 "was not a numeric port-number string."
849 msgstr ""
850 "I<node> lub I<service> nie jest znane; albo zarówno I<node> jak i I<service> "
851 "wynoszą NULL; albo w I<hints.ai_flags> podano B<AI_NUMERICSERV>, a "
852 "I<service> nie było numerycznym łańcuchem numeru portu."
853
854 #. type: TP
855 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
856 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
857 #, no-wrap
858 msgid "B<EAI_SERVICE>"
859 msgstr "B<EAI_SERVICE>"
860
861 #. type: Plain text
862 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
863 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
864 msgid ""
865 "The requested service is not available for the requested socket type. It "
866 "may be available through another socket type. For example, this error could "
867 "occur if I<service> was \"shell\" (a service available only on stream "
868 "sockets), and either I<hints.ai_protocol> was B<IPPROTO_UDP>, or "
869 "I<hints.ai_socktype> was B<SOCK_DGRAM>; or the error could occur if "
870 "I<service> was not NULL, and I<hints.ai_socktype> was B<SOCK_RAW> (a socket "
871 "type that does not support the concept of services)."
872 msgstr ""
873 "Żądana usługa nie jest dostępna dla żądanego typu portu. Może być dostępna "
874 "za pomocą innego typu portu. Ten błąd może wystąpić na przykład, gdy jako "
875 "I<service> podano \\[Bq]shell\\[rq] (usługa dostępna tylko na gniazdach "
876 "strumieniowych), a I<hints.ai_protocol> wynosiło B<IPPROTO_UDP> albo "
877 "I<hints.ai_socktype> wynosiło B<SOCK_DGRAM>; albo błąd może wystąpić gdy "
878 "I<service> nie wynosiło NULL, a I<hints.ai_socktype> wynosiło B<SOCK_RAW> "
879 "(typ gniazda, w ogóle nie obsługujący koncepcji usług)."
880
881 #. type: TP
882 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
883 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
884 #, no-wrap
885 msgid "B<EAI_SOCKTYPE>"
886 msgstr "B<EAI_SOCKTYPE>"
887
888 #. type: Plain text
889 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
890 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
891 msgid ""
892 "The requested socket type is not supported. This could occur, for example, "
893 "if I<hints.ai_socktype> and I<hints.ai_protocol> are inconsistent (e.g., "
894 "B<SOCK_DGRAM> and B<IPPROTO_TCP>, respectively)."
895 msgstr ""
896 "Żądany typ gniazda nie jest obsługiwany. Może się to zdarzyć na przykład, "
897 "gdy I<hints.ai_socktype> i I<hints.ai_protocol> są niespójne (np. wynoszą, "
898 "odpowiednio, B<SOCK_DGRAM> i B<IPPROTO_TCP>)."
899
900 #. type: TP
901 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
902 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
903 #, no-wrap
904 msgid "B<EAI_SYSTEM>"
905 msgstr "B<EAI_SYSTEM>"
906
907 #. type: Plain text
908 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
909 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
910 msgid "Other system error; I<errno> is set to indicate the error."
911 msgstr "Inny błąd systemowy; ustawiane jest I<errno> aby wskazać błąd."
912
913 #. type: Plain text
914 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
915 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
916 msgid ""
917 "The B<gai_strerror>() function translates these error codes to a human "
918 "readable string, suitable for error reporting."
919 msgstr ""
920 "Funkcja B<gai_strerror>() tłumaczy te kody błędów na czytelny dla człowieka "
921 "łańcuch, odpowiedni do zgłaszania błędów."
922
923 #. type: SH
924 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
925 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
926 #, no-wrap
927 msgid "FILES"
928 msgstr "PLIKI"
929
930 #. type: Plain text
931 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
932 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
933 msgid "I</etc/gai.conf>"
934 msgstr "I</etc/gai.conf>"
935
936 #. type: SH
937 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
938 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
939 #, no-wrap
940 msgid "ATTRIBUTES"
941 msgstr "ATRYBUTY"
942
943 #. type: Plain text
944 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
945 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
946 msgid ""
947 "For an explanation of the terms used in this section, see B<attributes>(7)."
948 msgstr ""
949 "Informacje o pojęciach używanych w tym rozdziale można znaleźć w podręczniku "
950 "B<attributes>(7)."
951
952 #. type: tbl table
953 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
954 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
955 #, no-wrap
956 msgid "Interface"
957 msgstr "Interfejs"
958
959 #. type: tbl table
960 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
961 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
962 #, no-wrap
963 msgid "Attribute"
964 msgstr "Atrybut"
965
966 #. type: tbl table
967 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
968 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
969 #, no-wrap
970 msgid "Value"
971 msgstr "Wartość"
972
973 #. type: tbl table
974 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
975 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
976 #, no-wrap
977 msgid ".na\n"
978 msgstr ".na\n"
979
980 #. type: tbl table
981 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
982 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
983 #, no-wrap
984 msgid ".nh\n"
985 msgstr ".nh\n"
986
987 #. type: TP
988 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
989 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
990 #, no-wrap
991 msgid "B<getaddrinfo>()"
992 msgstr "B<getaddrinfo>()"
993
994 #. type: tbl table
995 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
996 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
997 #, no-wrap
998 msgid "Thread safety"
999 msgstr "Bezpieczeństwo wątkowe"
1000
1001 #. type: tbl table
1002 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1003 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1004 #, no-wrap
1005 msgid "MT-Safe env locale"
1006 msgstr "MT-bezpieczne env locale"
1007
1008 #. type: tbl table
1009 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1010 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1011 #, no-wrap
1012 msgid ""
1013 "B<freeaddrinfo>(),\n"
1014 "B<gai_strerror>()"
1015 msgstr ""
1016 "B<freeaddrinfo>(),\n"
1017 "B<gai_strerror>()"
1018
1019 #. type: tbl table
1020 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1021 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1022 #, no-wrap
1023 msgid "MT-Safe"
1024 msgstr "MT-bezpieczne"
1025
1026 #. type: SH
1027 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1028 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1029 #, no-wrap
1030 msgid "VERSIONS"
1031 msgstr "WERSJE"
1032
1033 #. POSIX.1-2001, POSIX.1-2008
1034 #. type: Plain text
1035 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1036 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1037 msgid ""
1038 "According to POSIX.1, specifying I<hints> as NULL should cause I<ai_flags> "
1039 "to be assumed as 0. The GNU C library instead assumes a value of "
1040 "B<(AI_V4MAPPED\\ |\\ AI_ADDRCONFIG)> for this case, since this value is "
1041 "considered an improvement on the specification."
1042 msgstr ""
1043 "Zgodnie z POSIX.1, określenie I<hints> jako NULL, powinno powodować "
1044 "przyjęcie I<ai_flags> jako 0. Biblioteka GNU C zamiast tego przyjmuje w tym "
1045 "przypadku wartość B<(AI_V4MAPPED\\ |\\~AI_ADDRCONFIG)>, ponieważ wartość ta "
1046 "jest uważana za lepszą od przewidzianej normą."
1047
1048 #. type: SH
1049 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1050 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1051 #, no-wrap
1052 msgid "STANDARDS"
1053 msgstr "STANDARDY"
1054
1055 #. type: Plain text
1056 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1057 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1058 msgid "POSIX.1-2008."
1059 msgstr "POSIX.1-2008."
1060
1061 #. type: Plain text
1062 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1063 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1064 msgid "RFC\\ 2553."
1065 msgstr "RFC\\ 2553."
1066
1067 #. type: SH
1068 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1069 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1070 #, no-wrap
1071 msgid "HISTORY"
1072 msgstr "HISTORIA"
1073
1074 #. type: Plain text
1075 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1076 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1077 msgid "POSIX.1-2001."
1078 msgstr "POSIX.1-2001."
1079
1080 #. type: TP
1081 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1082 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1083 #, no-wrap
1084 msgid "B<AI_ADDRCONFIG>"
1085 msgstr "B<AI_ADDRCONFIG>"
1086
1087 #. type: TQ
1088 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1089 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1090 #, no-wrap
1091 msgid "B<AI_ALL>"
1092 msgstr "B<AI_ALL>"
1093
1094 #. type: TQ
1095 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1096 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1097 #, no-wrap
1098 msgid "B<AI_V4MAPPED>"
1099 msgstr "B<AI_V4MAPPED>"
1100
1101 #. type: Plain text
1102 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1103 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1104 msgid "glibc 2.3.3."
1105 msgstr "glibc 2.3.3."
1106
1107 #. type: TP
1108 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1109 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1110 #, no-wrap
1111 msgid "B<AI_NUMERICSERV>"
1112 msgstr "B<AI_NUMERICSERV>"
1113
1114 #. type: Plain text
1115 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1116 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1117 msgid "glibc 2.3.4."
1118 msgstr "glibc 2.3.4."
1119
1120 #. type: SH
1121 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1122 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1123 #, no-wrap
1124 msgid "NOTES"
1125 msgstr "UWAGI"
1126
1127 #. type: Plain text
1128 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1129 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1130 msgid ""
1131 "B<getaddrinfo>() supports the I<address>B<%>I<scope-id> notation for "
1132 "specifying the IPv6 scope-ID."
1133 msgstr ""
1134 "B<getaddrinfo>() obsługuje notację I<adres>B<%>I<identyfikator-zasięgu> do "
1135 "określenia identyfikatora zasięgu IPv6."
1136
1137 #. type: SH
1138 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1139 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1140 #, no-wrap
1141 msgid "EXAMPLES"
1142 msgstr "PRZYKŁADY"
1143
1144 #. getnameinfo.3 refers to this example
1145 #. socket.2 refers to this example
1146 #. bind.2 refers to this example
1147 #. connect.2 refers to this example
1148 #. recvfrom.2 refers to this example
1149 #. sendto.2 refers to this example
1150 #. type: Plain text
1151 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1152 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1153 msgid ""
1154 "The following programs demonstrate the use of B<getaddrinfo>(), "
1155 "B<gai_strerror>(), B<freeaddrinfo>(), and B<getnameinfo>(3). The programs "
1156 "are an echo server and client for UDP datagrams."
1157 msgstr ""
1158 "Poniższe programy demonstrują użycie B<getaddrinfo>(), B<gai_strerror>(), "
1159 "B<freeaddrinfo>() i B<getnameinfo>(3). Programy są serwerem i klientem typu "
1160 "echo dla datagramów UDP."
1161
1162 #. type: SS
1163 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1164 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1165 #, no-wrap
1166 msgid "Server program"
1167 msgstr "Program serwera"
1168
1169 #. type: Plain text
1170 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1171 #: opensuse-tumbleweed
1172 #, no-wrap
1173 msgid ""
1174 "#include E<lt>netdb.hE<gt>\n"
1175 "#include E<lt>stdio.hE<gt>\n"
1176 "#include E<lt>stdlib.hE<gt>\n"
1177 "#include E<lt>string.hE<gt>\n"
1178 "#include E<lt>sys/socket.hE<gt>\n"
1179 "#include E<lt>sys/types.hE<gt>\n"
1180 "#include E<lt>unistd.hE<gt>\n"
1181 "\\&\n"
1182 "#define BUF_SIZE 500\n"
1183 "\\&\n"
1184 "int\n"
1185 "main(int argc, char *argv[])\n"
1186 "{\n"
1187 " int sfd, s;\n"
1188 " char buf[BUF_SIZE];\n"
1189 " ssize_t nread;\n"
1190 " socklen_t peer_addrlen;\n"
1191 " struct addrinfo hints;\n"
1192 " struct addrinfo *result, *rp;\n"
1193 " struct sockaddr_storage peer_addr;\n"
1194 "\\&\n"
1195 " if (argc != 2) {\n"
1196 " fprintf(stderr, \"Usage: %s port\\[rs]n\", argv[0]);\n"
1197 " exit(EXIT_FAILURE);\n"
1198 " }\n"
1199 "\\&\n"
1200 " memset(&hints, 0, sizeof(hints));\n"
1201 " hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */\n"
1202 " hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */\n"
1203 " hints.ai_flags = AI_PASSIVE; /* For wildcard IP address */\n"
1204 " hints.ai_protocol = 0; /* Any protocol */\n"
1205 " hints.ai_canonname = NULL;\n"
1206 " hints.ai_addr = NULL;\n"
1207 " hints.ai_next = NULL;\n"
1208 "\\&\n"
1209 " s = getaddrinfo(NULL, argv[1], &hints, &result);\n"
1210 " if (s != 0) {\n"
1211 " fprintf(stderr, \"getaddrinfo: %s\\[rs]n\", gai_strerror(s));\n"
1212 " exit(EXIT_FAILURE);\n"
1213 " }\n"
1214 "\\&\n"
1215 " /* getaddrinfo() returns a list of address structures.\n"
1216 " Try each address until we successfully bind(2).\n"
1217 " If socket(2) (or bind(2)) fails, we (close the socket\n"
1218 " and) try the next address. */\n"
1219 "\\&\n"
1220 " for (rp = result; rp != NULL; rp = rp-E<gt>ai_next) {\n"
1221 " sfd = socket(rp-E<gt>ai_family, rp-E<gt>ai_socktype,\n"
1222 " rp-E<gt>ai_protocol);\n"
1223 " if (sfd == -1)\n"
1224 " continue;\n"
1225 "\\&\n"
1226 " if (bind(sfd, rp-E<gt>ai_addr, rp-E<gt>ai_addrlen) == 0)\n"
1227 " break; /* Success */\n"
1228 "\\&\n"
1229 " close(sfd);\n"
1230 " }\n"
1231 "\\&\n"
1232 " freeaddrinfo(result); /* No longer needed */\n"
1233 "\\&\n"
1234 " if (rp == NULL) { /* No address succeeded */\n"
1235 " fprintf(stderr, \"Could not bind\\[rs]n\");\n"
1236 " exit(EXIT_FAILURE);\n"
1237 " }\n"
1238 "\\&\n"
1239 " /* Read datagrams and echo them back to sender. */\n"
1240 "\\&\n"
1241 " for (;;) {\n"
1242 " char host[NI_MAXHOST], service[NI_MAXSERV];\n"
1243 "\\&\n"
1244 " peer_addrlen = sizeof(peer_addr);\n"
1245 " nread = recvfrom(sfd, buf, BUF_SIZE, 0,\n"
1246 " (struct sockaddr *) &peer_addr, &peer_addrlen);\n"
1247 " if (nread == -1)\n"
1248 " continue; /* Ignore failed request */\n"
1249 "\\&\n"
1250 " s = getnameinfo((struct sockaddr *) &peer_addr,\n"
1251 " peer_addrlen, host, NI_MAXHOST,\n"
1252 " service, NI_MAXSERV, NI_NUMERICSERV);\n"
1253 " if (s == 0)\n"
1254 " printf(\"Received %zd bytes from %s:%s\\[rs]n\",\n"
1255 " nread, host, service);\n"
1256 " else\n"
1257 " fprintf(stderr, \"getnameinfo: %s\\[rs]n\", gai_strerror(s));\n"
1258 "\\&\n"
1259 " if (sendto(sfd, buf, nread, 0, (struct sockaddr *) &peer_addr,\n"
1260 " peer_addrlen) != nread)\n"
1261 " {\n"
1262 " fprintf(stderr, \"Error sending response\\[rs]n\");\n"
1263 " }\n"
1264 " }\n"
1265 "}\n"
1266 msgstr ""
1267 "#include E<lt>netdb.hE<gt>\n"
1268 "#include E<lt>stdio.hE<gt>\n"
1269 "#include E<lt>stdlib.hE<gt>\n"
1270 "#include E<lt>string.hE<gt>\n"
1271 "#include E<lt>sys/socket.hE<gt>\n"
1272 "#include E<lt>sys/types.hE<gt>\n"
1273 "#include E<lt>unistd.hE<gt>\n"
1274 "\\&\n"
1275 "#define BUF_SIZE 500\n"
1276 "\\&\n"
1277 "int\n"
1278 "main(int argc, char *argv[])\n"
1279 "{\n"
1280 " int sfd, s;\n"
1281 " char buf[BUF_SIZE];\n"
1282 " ssize_t nread;\n"
1283 " socklen_t peer_addrlen;\n"
1284 " struct addrinfo hints;\n"
1285 " struct addrinfo *result, *rp;\n"
1286 " struct sockaddr_storage peer_addr;\n"
1287 "\\&\n"
1288 " if (argc != 2) {\n"
1289 " fprintf(stderr, \"Użycie: %s port\\[rs]n\", argv[0]);\n"
1290 " exit(EXIT_FAILURE);\n"
1291 " }\n"
1292 "\\&\n"
1293 " memset(&hints, 0, sizeof(hints));\n"
1294 " hints.ai_family = AF_UNSPEC; /* Zezwala na IPv4 lub IPv6 */\n"
1295 " hints.ai_socktype = SOCK_DGRAM; /* Gniazdo datagramowe */\n"
1296 " hints.ai_flags = AI_PASSIVE; /* Dla wieloznacznego adresu IP */\n"
1297 " hints.ai_protocol = 0; /* Dowolny protokół */\n"
1298 " hints.ai_canonname = NULL;\n"
1299 " hints.ai_addr = NULL;\n"
1300 " hints.ai_next = NULL;\n"
1301 "\\&\n"
1302 " s = getaddrinfo(NULL, argv[1], &hints, &result);\n"
1303 " if (s != 0) {\n"
1304 " fprintf(stderr, \"getaddrinfo: %s\\[rs]n\", gai_strerror(s));\n"
1305 " exit(EXIT_FAILURE);\n"
1306 " }\n"
1307 "\\&\n"
1308 " /* getaddrinfo() zwraca listę struktur adresów. Próbowany\n"
1309 " jest każdy adres do momentu pomyślnego bind(2).\n"
1310 " Jeśli socket(2) (lub bind(2)) zawiedzie, (gniazdo jest\n"
1311 " jest zamykane i) próbowany jest następny adres. */\n"
1312 "\\&\n"
1313 " for (rp = result; rp != NULL; rp = rp-E<gt>ai_next) {\n"
1314 " sfd = socket(rp-E<gt>ai_family, rp-E<gt>ai_socktype,\n"
1315 " rp-E<gt>ai_protocol);\n"
1316 " if (sfd == -1)\n"
1317 " continue;\n"
1318 "\\&\n"
1319 " if (bind(sfd, rp-E<gt>ai_addr, rp-E<gt>ai_addrlen) == 0)\n"
1320 " break; /* Powodzenie */\n"
1321 "\\&\n"
1322 " close(sfd);\n"
1323 " }\n"
1324 "\\&\n"
1325 " freeaddrinfo(result); /* Nie jest już potrzebne */\n"
1326 "\\&\n"
1327 " if (rp == NULL) { /* Nie udało się z żadnym adresem */\n"
1328 " fprintf(stderr, \"Przypisanie nie powiodło się\\[rs]n\");\n"
1329 " exit(EXIT_FAILURE);\n"
1330 " }\n"
1331 "\\&\n"
1332 " /* Odczytuje datagramy i odsyła je wysyłającemu. */\n"
1333 "\\&\n"
1334 " for (;;) {\n"
1335 " char host[NI_MAXHOST], service[NI_MAXSERV];\n"
1336 "\\&\n"
1337 " peer_addrlen = sizeof(peer_addr);\n"
1338 " nread = recvfrom(sfd, buf, BUF_SIZE, 0,\n"
1339 " (struct sockaddr *) &peer_addr, &peer_addrlen);\n"
1340 " if (nread == -1)\n"
1341 " continue; /* Ignoruje niepomyślne żądanie */\n"
1342 "\\&\n"
1343 " s = getnameinfo((struct sockaddr *) &peer_addr,\n"
1344 " peer_addrlen, host, NI_MAXHOST,\n"
1345 " service, NI_MAXSERV, NI_NUMERICSERV);\n"
1346 " if (s == 0)\n"
1347 " printf(\"Otrzymano %zd bajtów z %s:%s\\[rs]n\",\n"
1348 " nread, host, service);\n"
1349 " else\n"
1350 " fprintf(stderr, \"getnameinfo: %s\\[rs]n\", gai_strerror(s));\n"
1351 "\\&\n"
1352 " if (sendto(sfd, buf, nread, 0, (struct sockaddr *) &peer_addr,\n"
1353 " peer_addrlen) != nread)\n"
1354 " {\n"
1355 " fprintf(stderr, \"Błąd przy wysyłaniu odpowiedzi\\[rs]n\");\n"
1356 " }\n"
1357 " }\n"
1358 "}\n"
1359
1360 #. SRC END
1361 #. type: SS
1362 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1363 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1364 #, no-wrap
1365 msgid "Client program"
1366 msgstr "Program klienta"
1367
1368 #. type: Plain text
1369 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1370 #: opensuse-tumbleweed
1371 #, no-wrap
1372 msgid ""
1373 "#include E<lt>netdb.hE<gt>\n"
1374 "#include E<lt>stdio.hE<gt>\n"
1375 "#include E<lt>stdlib.hE<gt>\n"
1376 "#include E<lt>string.hE<gt>\n"
1377 "#include E<lt>sys/socket.hE<gt>\n"
1378 "#include E<lt>sys/types.hE<gt>\n"
1379 "#include E<lt>unistd.hE<gt>\n"
1380 "\\&\n"
1381 "#define BUF_SIZE 500\n"
1382 "\\&\n"
1383 "int\n"
1384 "main(int argc, char *argv[])\n"
1385 "{\n"
1386 " int sfd, s;\n"
1387 " char buf[BUF_SIZE];\n"
1388 " size_t size;\n"
1389 " ssize_t nread;\n"
1390 " struct addrinfo hints;\n"
1391 " struct addrinfo *result, *rp;\n"
1392 "\\&\n"
1393 " if (argc E<lt> 3) {\n"
1394 " fprintf(stderr, \"Usage: %s host port msg...\\[rs]n\", argv[0]);\n"
1395 " exit(EXIT_FAILURE);\n"
1396 " }\n"
1397 "\\&\n"
1398 " /* Obtain address(es) matching host/port. */\n"
1399 "\\&\n"
1400 " memset(&hints, 0, sizeof(hints));\n"
1401 " hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */\n"
1402 " hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */\n"
1403 " hints.ai_flags = 0;\n"
1404 " hints.ai_protocol = 0; /* Any protocol */\n"
1405 "\\&\n"
1406 " s = getaddrinfo(argv[1], argv[2], &hints, &result);\n"
1407 " if (s != 0) {\n"
1408 " fprintf(stderr, \"getaddrinfo: %s\\[rs]n\", gai_strerror(s));\n"
1409 " exit(EXIT_FAILURE);\n"
1410 " }\n"
1411 "\\&\n"
1412 " /* getaddrinfo() returns a list of address structures.\n"
1413 " Try each address until we successfully connect(2).\n"
1414 " If socket(2) (or connect(2)) fails, we (close the socket\n"
1415 " and) try the next address. */\n"
1416 "\\&\n"
1417 " for (rp = result; rp != NULL; rp = rp-E<gt>ai_next) {\n"
1418 " sfd = socket(rp-E<gt>ai_family, rp-E<gt>ai_socktype,\n"
1419 " rp-E<gt>ai_protocol);\n"
1420 " if (sfd == -1)\n"
1421 " continue;\n"
1422 "\\&\n"
1423 " if (connect(sfd, rp-E<gt>ai_addr, rp-E<gt>ai_addrlen) != -1)\n"
1424 " break; /* Success */\n"
1425 "\\&\n"
1426 " close(sfd);\n"
1427 " }\n"
1428 "\\&\n"
1429 " freeaddrinfo(result); /* No longer needed */\n"
1430 "\\&\n"
1431 " if (rp == NULL) { /* No address succeeded */\n"
1432 " fprintf(stderr, \"Could not connect\\[rs]n\");\n"
1433 " exit(EXIT_FAILURE);\n"
1434 " }\n"
1435 "\\&\n"
1436 " /* Send remaining command-line arguments as separate\n"
1437 " datagrams, and read responses from server. */\n"
1438 "\\&\n"
1439 " for (size_t j = 3; j E<lt> argc; j++) {\n"
1440 " size = strlen(argv[j]) + 1;\n"
1441 " /* +1 for terminating null byte */\n"
1442 "\\&\n"
1443 " if (size E<gt> BUF_SIZE) {\n"
1444 " fprintf(stderr,\n"
1445 " \"Ignoring long message in argument %zu\\[rs]n\", j);\n"
1446 " continue;\n"
1447 " }\n"
1448 "\\&\n"
1449 " if (write(sfd, argv[j], size) != size) {\n"
1450 " fprintf(stderr, \"partial/failed write\\[rs]n\");\n"
1451 " exit(EXIT_FAILURE);\n"
1452 " }\n"
1453 "\\&\n"
1454 " nread = read(sfd, buf, BUF_SIZE);\n"
1455 " if (nread == -1) {\n"
1456 " perror(\"read\");\n"
1457 " exit(EXIT_FAILURE);\n"
1458 " }\n"
1459 "\\&\n"
1460 " printf(\"Received %zd bytes: %s\\[rs]n\", nread, buf);\n"
1461 " }\n"
1462 "\\&\n"
1463 " exit(EXIT_SUCCESS);\n"
1464 "}\n"
1465 msgstr ""
1466 "#include E<lt>netdb.hE<gt>\n"
1467 "#include E<lt>stdio.hE<gt>\n"
1468 "#include E<lt>stdlib.hE<gt>\n"
1469 "#include E<lt>string.hE<gt>\n"
1470 "#include E<lt>sys/socket.hE<gt>\n"
1471 "#include E<lt>sys/types.hE<gt>\n"
1472 "#include E<lt>unistd.hE<gt>\n"
1473 "\\&\n"
1474 "#define BUF_SIZE 500\n"
1475 "\\&\n"
1476 "int\n"
1477 "main(int argc, char *argv[])\n"
1478 "{\n"
1479 " int sfd, s;\n"
1480 " char buf[BUF_SIZE];\n"
1481 " size_t size;\n"
1482 " ssize_t nread;\n"
1483 " struct addrinfo hints;\n"
1484 " struct addrinfo *result, *rp;\n"
1485 "\\&\n"
1486 " if (argc E<lt> 3) {\n"
1487 " fprintf(stderr, \"Użycie: %s stacja port komunik...\\[rs]n\", argv[0]);\n"
1488 " exit(EXIT_FAILURE);\n"
1489 " }\n"
1490 "\\&\n"
1491 " /* Pozyskuje adres(y) pasującej stacji/portu. */\n"
1492 "\\&\n"
1493 " memset(&hints, 0, sizeof(hints));\n"
1494 " hints.ai_family = AF_UNSPEC; /* Zezwala na IPv4 lub IPv6 */\n"
1495 " hints.ai_socktype = SOCK_DGRAM; /* Gniazdo datagramowe */\n"
1496 " hints.ai_flags = 0;\n"
1497 " hints.ai_protocol = 0; /* Dowolny protokół */\n"
1498 "\\&\n"
1499 " s = getaddrinfo(argv[1], argv[2], &hints, &result);\n"
1500 " if (s != 0) {\n"
1501 " fprintf(stderr, \"getaddrinfo: %s\\[rs]n\", gai_strerror(s));\n"
1502 " exit(EXIT_FAILURE);\n"
1503 " }\n"
1504 "\\&\n"
1505 " /* getaddrinfo() zwraca listę struktur adresów. Próbuje\n"
1506 " każdego adresu, do pomyślnego połączenia (connect(2)).\n"
1507 " Jeśli socket(2) (lub connect(2)) zawiedzie, (zamykamy\n"
1508 " gniazdo i) próbujemy następny adres. */\n"
1509 "\\&\n"
1510 " for (rp = result; rp != NULL; rp = rp-E<gt>ai_next) {\n"
1511 " sfd = socket(rp-E<gt>ai_family, rp-E<gt>ai_socktype,\n"
1512 " rp-E<gt>ai_protocol);\n"
1513 " if (sfd == -1)\n"
1514 " continue;\n"
1515 "\\&\n"
1516 " if (connect(sfd, rp-E<gt>ai_addr, rp-E<gt>ai_addrlen) != -1)\n"
1517 " break; /* Powodzenie */\n"
1518 "\\&\n"
1519 " close(sfd);\n"
1520 " }\n"
1521 "\\&\n"
1522 " freeaddrinfo(result); /* Nie jest już potrzebne */\n"
1523 "\\&\n"
1524 " if (rp == NULL) { /* Nie udało się z żadnym adresem */\n"
1525 " fprintf(stderr, \"Nie udało się połączyć\\[rs]n\");\n"
1526 " exit(EXIT_FAILURE);\n"
1527 " }\n"
1528 "\\&\n"
1529 " /* Wysyła pozostałe argumenty wiersza poleceń jako oddzielne\n"
1530 " datagramy i odczytuje odpowiedzi z serwera. */\n"
1531 "\\&\n"
1532 " for (size_t j = 3; j E<lt> argc; j++) {\n"
1533 " size = strlen(argv[j]) + 1;\n"
1534 " /* +1 dla końcowego bajtu null */\n"
1535 "\\&\n"
1536 " if (size E<gt> BUF_SIZE) {\n"
1537 " fprintf(stderr,\n"
1538 " \"Ignorowanie długiego komunikatu w argumencie %zu\\[rs]n\", j);\n"
1539 " continue;\n"
1540 " }\n"
1541 "\\&\n"
1542 " if (write(sfd, argv[j], size) != size) {\n"
1543 " fprintf(stderr, \"częściowy/nieudany zapis\\[rs]n\");\n"
1544 " exit(EXIT_FAILURE);\n"
1545 " }\n"
1546 "\\&\n"
1547 " nread = read(sfd, buf, BUF_SIZE);\n"
1548 " if (nread == -1) {\n"
1549 " perror(\"read\");\n"
1550 " exit(EXIT_FAILURE);\n"
1551 " }\n"
1552 "\\&\n"
1553 " printf(\"Otrzymano %zd bajtów: %s\\[rs]n\", nread, buf);\n"
1554 " }\n"
1555 "\\&\n"
1556 " exit(EXIT_SUCCESS);\n"
1557 "}\n"
1558
1559 #. SRC END
1560 #. type: SH
1561 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1562 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1563 #, no-wrap
1564 msgid "SEE ALSO"
1565 msgstr "ZOBACZ TAKŻE"
1566
1567 #. .BR getipnodebyaddr (3),
1568 #. .BR getipnodebyname (3),
1569 #. type: Plain text
1570 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1571 #: mageia-cauldron
1572 msgid ""
1573 "B<getaddrinfo_a>(3), B<gethostbyname>(3), B<getnameinfo>(3), B<inet>(3), "
1574 "B<gai.conf>(5), B<hostname>(7), B<ip>(7)"
1575 msgstr ""
1576 "B<getaddrinfo_a>(3), B<gethostbyname>(3), B<getnameinfo>(3), B<inet>(3), "
1577 "B<gai.conf>(5), B<hostname>(7), B<ip>(7)"
1578
1579 #. type: TH
1580 #: debian-trixie
1581 #, no-wrap
1582 msgid "2024-06-15"
1583 msgstr "15 czerwca 2024 r."
1584
1585 #. type: TH
1586 #: debian-trixie
1587 #, no-wrap
1588 msgid "Linux man-pages 6.9.1"
1589 msgstr "Linux man-pages 6.9.1"
1590
1591 #. type: Plain text
1592 #: debian-trixie
1593 msgid "Standard C library (I<libc>, I<-lc>)"
1594 msgstr "Standardowa biblioteka C (I<libc>, I<-lc>)"
1595
1596 #. type: Plain text
1597 #: debian-trixie
1598 msgid ""
1599 "A pointer to the socket address is placed in the I<ai_addr> field, and the "
1600 "length of the socket address, in bytes, is placed in the I<ai_addrlen> field."
1601 msgstr ""
1602 "Wskaźnik do adresu gniazda jest umieszczany w polu I<ai_addr>, a długość "
1603 "adresu gniazda w bajtach, jest umieszczana w polu I<ai_addrlen>."
1604
1605 #. type: Plain text
1606 #: debian-trixie fedora-44 fedora-rawhide
1607 #, no-wrap
1608 msgid ""
1609 "#include E<lt>netdb.hE<gt>\n"
1610 "#include E<lt>stdio.hE<gt>\n"
1611 "#include E<lt>stdlib.hE<gt>\n"
1612 "#include E<lt>string.hE<gt>\n"
1613 "#include E<lt>sys/socket.hE<gt>\n"
1614 "#include E<lt>sys/types.hE<gt>\n"
1615 "#include E<lt>unistd.hE<gt>\n"
1616 "\\&\n"
1617 "#define BUF_SIZE 500\n"
1618 "\\&\n"
1619 "int\n"
1620 "main(int argc, char *argv[])\n"
1621 "{\n"
1622 " int sfd, s;\n"
1623 " char buf[BUF_SIZE];\n"
1624 " ssize_t nread;\n"
1625 " socklen_t peer_addrlen;\n"
1626 " struct addrinfo hints;\n"
1627 " struct addrinfo *result, *rp;\n"
1628 " struct sockaddr_storage peer_addr;\n"
1629 "\\&\n"
1630 " if (argc != 2) {\n"
1631 " fprintf(stderr, \"Usage: %s port\\[rs]n\", argv[0]);\n"
1632 " exit(EXIT_FAILURE);\n"
1633 " }\n"
1634 "\\&\n"
1635 " memset(&hints, 0, sizeof(hints));\n"
1636 " hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */\n"
1637 " hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */\n"
1638 " hints.ai_flags = AI_PASSIVE; /* For wildcard IP address */\n"
1639 " hints.ai_protocol = 0; /* Any protocol */\n"
1640 " hints.ai_canonname = NULL;\n"
1641 " hints.ai_addr = NULL;\n"
1642 " hints.ai_next = NULL;\n"
1643 "\\&\n"
1644 " s = getaddrinfo(NULL, argv[1], &hints, &result);\n"
1645 " if (s != 0) {\n"
1646 " fprintf(stderr, \"getaddrinfo: %s\\[rs]n\", gai_strerror(s));\n"
1647 " exit(EXIT_FAILURE);\n"
1648 " }\n"
1649 "\\&\n"
1650 " /* getaddrinfo() returns a list of address structures.\n"
1651 " Try each address until we successfully bind(2).\n"
1652 " If socket(2) (or bind(2)) fails, we (close the socket\n"
1653 " and) try the next address. */\n"
1654 "\\&\n"
1655 " for (rp = result; rp != NULL; rp = rp-E<gt>ai_next) {\n"
1656 " sfd = socket(rp-E<gt>ai_family, rp-E<gt>ai_socktype,\n"
1657 " rp-E<gt>ai_protocol);\n"
1658 " if (sfd == -1)\n"
1659 " continue;\n"
1660 "\\&\n"
1661 " if (bind(sfd, rp-E<gt>ai_addr, rp-E<gt>ai_addrlen) == 0)\n"
1662 " break; /* Success */\n"
1663 "\\&\n"
1664 " close(sfd);\n"
1665 " }\n"
1666 "\\&\n"
1667 " freeaddrinfo(result); /* No longer needed */\n"
1668 "\\&\n"
1669 " if (rp == NULL) { /* No address succeeded */\n"
1670 " fprintf(stderr, \"Could not bind\\[rs]n\");\n"
1671 " exit(EXIT_FAILURE);\n"
1672 " }\n"
1673 "\\&\n"
1674 " /* Read datagrams and echo them back to sender. */\n"
1675 "\\&\n"
1676 " for (;;) {\n"
1677 " char host[NI_MAXHOST], service[NI_MAXSERV];\n"
1678 "\\&\n"
1679 " peer_addrlen = sizeof(peer_addr);\n"
1680 " nread = recvfrom(sfd, buf, BUF_SIZE, 0,\n"
1681 " (struct sockaddr *) &peer_addr, &peer_addrlen);\n"
1682 " if (nread == -1)\n"
1683 " continue; /* Ignore failed request */\n"
1684 "\\&\n"
1685 " s = getnameinfo((struct sockaddr *) &peer_addr,\n"
1686 " peer_addrlen, host, NI_MAXHOST,\n"
1687 " service, NI_MAXSERV, NI_NUMERICSERV);\n"
1688 " if (s == 0)\n"
1689 " printf(\"Received %zd bytes from %s:%s\\[rs]n\",\n"
1690 " nread, host, service);\n"
1691 " else\n"
1692 " fprintf(stderr, \"getnameinfo: %s\\[rs]n\", gai_strerror(s));\n"
1693 "\\&\n"
1694 " if (sendto(sfd, buf, nread, 0, (struct sockaddr *) &peer_addr,\n"
1695 " peer_addrlen) != nread)\n"
1696 " {\n"
1697 " fprintf(stderr, \"Error sending response\\[rs]n\");\n"
1698 " }\n"
1699 " }\n"
1700 "}\n"
1701 msgstr ""
1702 "#include E<lt>netdb.hE<gt>\n"
1703 "#include E<lt>stdio.hE<gt>\n"
1704 "#include E<lt>stdlib.hE<gt>\n"
1705 "#include E<lt>string.hE<gt>\n"
1706 "#include E<lt>sys/socket.hE<gt>\n"
1707 "#include E<lt>sys/types.hE<gt>\n"
1708 "#include E<lt>unistd.hE<gt>\n"
1709 "\\&\n"
1710 "#define BUF_SIZE 500\n"
1711 "\\&\n"
1712 "int\n"
1713 "main(int argc, char *argv[])\n"
1714 "{\n"
1715 " int sfd, s;\n"
1716 " char buf[BUF_SIZE];\n"
1717 " ssize_t nread;\n"
1718 " socklen_t peer_addrlen;\n"
1719 " struct addrinfo hints;\n"
1720 " struct addrinfo *result, *rp;\n"
1721 " struct sockaddr_storage peer_addr;\n"
1722 "\\&\n"
1723 " if (argc != 2) {\n"
1724 " fprintf(stderr, \"Użycie: %s port\\[rs]n\", argv[0]);\n"
1725 " exit(EXIT_FAILURE);\n"
1726 " }\n"
1727 "\\&\n"
1728 " memset(&hints, 0, sizeof(hints));\n"
1729 " hints.ai_family = AF_UNSPEC; /* Zezwala na IPv4 lub IPv6 */\n"
1730 " hints.ai_socktype = SOCK_DGRAM; /* Gniazdo datagramowe */\n"
1731 " hints.ai_flags = AI_PASSIVE; /* Dla wieloznacznego adresu IP */\n"
1732 " hints.ai_protocol = 0; /* Dowolny protokół */\n"
1733 " hints.ai_canonname = NULL;\n"
1734 " hints.ai_addr = NULL;\n"
1735 " hints.ai_next = NULL;\n"
1736 "\\&\n"
1737 " s = getaddrinfo(NULL, argv[1], &hints, &result);\n"
1738 " if (s != 0) {\n"
1739 " fprintf(stderr, \"getaddrinfo: %s\\[rs]n\", gai_strerror(s));\n"
1740 " exit(EXIT_FAILURE);\n"
1741 " }\n"
1742 "\\&\n"
1743 " /* getaddrinfo() zwraca listę struktur adresów. Próbowany\n"
1744 " jest każdy adres do momentu pomyślnego bind(2).\n"
1745 " Jeśli socket(2) (lub bind(2)) zawiedzie, (gniazdo jest\n"
1746 " jest zamykane i) próbowany jest następny adres. */\n"
1747 "\\&\n"
1748 " for (rp = result; rp != NULL; rp = rp-E<gt>ai_next) {\n"
1749 " sfd = socket(rp-E<gt>ai_family, rp-E<gt>ai_socktype,\n"
1750 " rp-E<gt>ai_protocol);\n"
1751 " if (sfd == -1)\n"
1752 " continue;\n"
1753 "\\&\n"
1754 " if (bind(sfd, rp-E<gt>ai_addr, rp-E<gt>ai_addrlen) == 0)\n"
1755 " break; /* Powodzenie */\n"
1756 "\\&\n"
1757 " close(sfd);\n"
1758 " }\n"
1759 "\\&\n"
1760 " freeaddrinfo(result); /* Nie jest już potrzebne */\n"
1761 "\\&\n"
1762 " if (rp == NULL) { /* Nie udało się z żadnym adresem */\n"
1763 " fprintf(stderr, \"Przypisanie nie powiodło się\\[rs]n\");\n"
1764 " exit(EXIT_FAILURE);\n"
1765 " }\n"
1766 "\\&\n"
1767 " /* Odczytuje datagramy i odsyła je wysyłającemu. */\n"
1768 "\\&\n"
1769 " for (;;) {\n"
1770 " char host[NI_MAXHOST], service[NI_MAXSERV];\n"
1771 "\\&\n"
1772 " peer_addrlen = sizeof(peer_addr);\n"
1773 " nread = recvfrom(sfd, buf, BUF_SIZE, 0,\n"
1774 " (struct sockaddr *) &peer_addr, &peer_addrlen);\n"
1775 " if (nread == -1)\n"
1776 " continue; /* Ignoruje niepomyślne żądanie */\n"
1777 "\\&\n"
1778 " s = getnameinfo((struct sockaddr *) &peer_addr,\n"
1779 " peer_addrlen, host, NI_MAXHOST,\n"
1780 " service, NI_MAXSERV, NI_NUMERICSERV);\n"
1781 " if (s == 0)\n"
1782 " printf(\"Otrzymano %zd bajtów z %s:%s\\[rs]n\",\n"
1783 " nread, host, service);\n"
1784 " else\n"
1785 " fprintf(stderr, \"getnameinfo: %s\\[rs]n\", gai_strerror(s));\n"
1786 "\\&\n"
1787 " if (sendto(sfd, buf, nread, 0, (struct sockaddr *) &peer_addr,\n"
1788 " peer_addrlen) != nread)\n"
1789 " {\n"
1790 " fprintf(stderr, \"Błąd przy wysyłaniu odpowiedzi\\[rs]n\");\n"
1791 " }\n"
1792 " }\n"
1793 "}\n"
1794
1795 #. type: Plain text
1796 #: debian-trixie
1797 #, no-wrap
1798 msgid ""
1799 "#include E<lt>netdb.hE<gt>\n"
1800 "#include E<lt>stdio.hE<gt>\n"
1801 "#include E<lt>stdlib.hE<gt>\n"
1802 "#include E<lt>string.hE<gt>\n"
1803 "#include E<lt>sys/socket.hE<gt>\n"
1804 "#include E<lt>sys/types.hE<gt>\n"
1805 "#include E<lt>unistd.hE<gt>\n"
1806 "\\&\n"
1807 "#define BUF_SIZE 500\n"
1808 "\\&\n"
1809 "int\n"
1810 "main(int argc, char *argv[])\n"
1811 "{\n"
1812 " int sfd, s;\n"
1813 " char buf[BUF_SIZE];\n"
1814 " size_t len;\n"
1815 " ssize_t nread;\n"
1816 " struct addrinfo hints;\n"
1817 " struct addrinfo *result, *rp;\n"
1818 "\\&\n"
1819 " if (argc E<lt> 3) {\n"
1820 " fprintf(stderr, \"Usage: %s host port msg...\\[rs]n\", argv[0]);\n"
1821 " exit(EXIT_FAILURE);\n"
1822 " }\n"
1823 "\\&\n"
1824 " /* Obtain address(es) matching host/port. */\n"
1825 "\\&\n"
1826 " memset(&hints, 0, sizeof(hints));\n"
1827 " hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */\n"
1828 " hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */\n"
1829 " hints.ai_flags = 0;\n"
1830 " hints.ai_protocol = 0; /* Any protocol */\n"
1831 "\\&\n"
1832 " s = getaddrinfo(argv[1], argv[2], &hints, &result);\n"
1833 " if (s != 0) {\n"
1834 " fprintf(stderr, \"getaddrinfo: %s\\[rs]n\", gai_strerror(s));\n"
1835 " exit(EXIT_FAILURE);\n"
1836 " }\n"
1837 "\\&\n"
1838 " /* getaddrinfo() returns a list of address structures.\n"
1839 " Try each address until we successfully connect(2).\n"
1840 " If socket(2) (or connect(2)) fails, we (close the socket\n"
1841 " and) try the next address. */\n"
1842 "\\&\n"
1843 " for (rp = result; rp != NULL; rp = rp-E<gt>ai_next) {\n"
1844 " sfd = socket(rp-E<gt>ai_family, rp-E<gt>ai_socktype,\n"
1845 " rp-E<gt>ai_protocol);\n"
1846 " if (sfd == -1)\n"
1847 " continue;\n"
1848 "\\&\n"
1849 " if (connect(sfd, rp-E<gt>ai_addr, rp-E<gt>ai_addrlen) != -1)\n"
1850 " break; /* Success */\n"
1851 "\\&\n"
1852 " close(sfd);\n"
1853 " }\n"
1854 "\\&\n"
1855 " freeaddrinfo(result); /* No longer needed */\n"
1856 "\\&\n"
1857 " if (rp == NULL) { /* No address succeeded */\n"
1858 " fprintf(stderr, \"Could not connect\\[rs]n\");\n"
1859 " exit(EXIT_FAILURE);\n"
1860 " }\n"
1861 "\\&\n"
1862 " /* Send remaining command-line arguments as separate\n"
1863 " datagrams, and read responses from server. */\n"
1864 "\\&\n"
1865 " for (size_t j = 3; j E<lt> argc; j++) {\n"
1866 " len = strlen(argv[j]) + 1;\n"
1867 " /* +1 for terminating null byte */\n"
1868 "\\&\n"
1869 " if (len E<gt> BUF_SIZE) {\n"
1870 " fprintf(stderr,\n"
1871 " \"Ignoring long message in argument %zu\\[rs]n\", j);\n"
1872 " continue;\n"
1873 " }\n"
1874 "\\&\n"
1875 " if (write(sfd, argv[j], len) != len) {\n"
1876 " fprintf(stderr, \"partial/failed write\\[rs]n\");\n"
1877 " exit(EXIT_FAILURE);\n"
1878 " }\n"
1879 "\\&\n"
1880 " nread = read(sfd, buf, BUF_SIZE);\n"
1881 " if (nread == -1) {\n"
1882 " perror(\"read\");\n"
1883 " exit(EXIT_FAILURE);\n"
1884 " }\n"
1885 "\\&\n"
1886 " printf(\"Received %zd bytes: %s\\[rs]n\", nread, buf);\n"
1887 " }\n"
1888 "\\&\n"
1889 " exit(EXIT_SUCCESS);\n"
1890 "}\n"
1891 msgstr ""
1892 "#include E<lt>netdb.hE<gt>\n"
1893 "#include E<lt>stdio.hE<gt>\n"
1894 "#include E<lt>stdlib.hE<gt>\n"
1895 "#include E<lt>string.hE<gt>\n"
1896 "#include E<lt>sys/socket.hE<gt>\n"
1897 "#include E<lt>sys/types.hE<gt>\n"
1898 "#include E<lt>unistd.hE<gt>\n"
1899 "\\&\n"
1900 "#define BUF_SIZE 500\n"
1901 "\\&\n"
1902 "int\n"
1903 "main(int argc, char *argv[])\n"
1904 "{\n"
1905 " int sfd, s;\n"
1906 " char buf[BUF_SIZE];\n"
1907 " size_t len;\n"
1908 " ssize_t nread;\n"
1909 " struct addrinfo hints;\n"
1910 " struct addrinfo *result, *rp;\n"
1911 "\\&\n"
1912 " if (argc E<lt> 3) {\n"
1913 " fprintf(stderr, \"Użycie: %s stacja port komunik...\\[rs]n\", argv[0]);\n"
1914 " exit(EXIT_FAILURE);\n"
1915 " }\n"
1916 "\\&\n"
1917 " /* Pozyskuje adres(y) pasującej stacji/portu. */\n"
1918 "\\&\n"
1919 " memset(&hints, 0, sizeof(hints));\n"
1920 " hints.ai_family = AF_UNSPEC; /* Zezwala na IPv4 lub IPv6 */\n"
1921 " hints.ai_socktype = SOCK_DGRAM; /* Gniazdo datagramowe */\n"
1922 " hints.ai_flags = 0;\n"
1923 " hints.ai_protocol = 0; /* Dowolny protokół */\n"
1924 "\\&\n"
1925 " s = getaddrinfo(argv[1], argv[2], &hints, &result);\n"
1926 " if (s != 0) {\n"
1927 " fprintf(stderr, \"getaddrinfo: %s\\[rs]n\", gai_strerror(s));\n"
1928 " exit(EXIT_FAILURE);\n"
1929 " }\n"
1930 "\\&\n"
1931 " /* getaddrinfo() zwraca listę struktur adresów. Próbuje\n"
1932 " każdego adresu, do pomyślnego połączenia (connect(2)).\n"
1933 " Jeśli socket(2) (lub connect(2)) zawiedzie, (zamykamy\n"
1934 " gniazdo i) próbujemy następny adres. */\n"
1935 "\\&\n"
1936 " for (rp = result; rp != NULL; rp = rp-E<gt>ai_next) {\n"
1937 " sfd = socket(rp-E<gt>ai_family, rp-E<gt>ai_socktype,\n"
1938 " rp-E<gt>ai_protocol);\n"
1939 " if (sfd == -1)\n"
1940 " continue;\n"
1941 "\\&\n"
1942 " if (connect(sfd, rp-E<gt>ai_addr, rp-E<gt>ai_addrlen) != -1)\n"
1943 " break; /* Powodzenie */\n"
1944 "\\&\n"
1945 " close(sfd);\n"
1946 " }\n"
1947 "\\&\n"
1948 " freeaddrinfo(result); /* Nie jest już potrzebne */\n"
1949 "\\&\n"
1950 " if (rp == NULL) { /* Nie udało się z żadnym adresem */\n"
1951 " fprintf(stderr, \"Nie udało się połączyć\\[rs]n\");\n"
1952 " exit(EXIT_FAILURE);\n"
1953 " }\n"
1954 "\\&\n"
1955 " /* Wysyła pozostałe argumenty wiersza poleceń jako oddzielne\n"
1956 " datagramy i odczytuje odpowiedzi z serwera. */\n"
1957 "\\&\n"
1958 " for (size_t j = 3; j E<lt> argc; j++) {\n"
1959 " len = strlen(argv[j]) + 1;\n"
1960 " /* +1 dla końcowego bajtu null */\n"
1961 "\\&\n"
1962 " if (len E<gt> BUF_SIZE) {\n"
1963 " fprintf(stderr,\n"
1964 " \"Ignorowanie długiego komunikatu w argumencie %zu\\[rs]n\", j);\n"
1965 " continue;\n"
1966 " }\n"
1967 "\\&\n"
1968 " if (write(sfd, argv[j], len) != len) {\n"
1969 " fprintf(stderr, \"częściowy/nieudany zapis\\[rs]n\");\n"
1970 " exit(EXIT_FAILURE);\n"
1971 " }\n"
1972 "\\&\n"
1973 " nread = read(sfd, buf, BUF_SIZE);\n"
1974 " if (nread == -1) {\n"
1975 " perror(\"read\");\n"
1976 " exit(EXIT_FAILURE);\n"
1977 " }\n"
1978 "\\&\n"
1979 " printf(\"Otrzymano %zd bajtów: %s\\[rs]n\", nread, buf);\n"
1980 " }\n"
1981 "\\&\n"
1982 " exit(EXIT_SUCCESS);\n"
1983 "}\n"
1984
1985 #. type: TH
1986 #: fedora-44 fedora-rawhide
1987 #, no-wrap
1988 msgid "2024-11-17"
1989 msgstr "17 listopada 2024 r."
1990
1991 #. type: TH
1992 #: fedora-44 fedora-rawhide
1993 #, no-wrap
1994 msgid "Linux man-pages 6.13"
1995 msgstr "Linux man-pages 6.13"
1996
1997 #. type: Plain text
1998 #: fedora-44 fedora-rawhide
1999 #, no-wrap
2000 msgid ""
2001 "#include E<lt>netdb.hE<gt>\n"
2002 "#include E<lt>stdio.hE<gt>\n"
2003 "#include E<lt>stdlib.hE<gt>\n"
2004 "#include E<lt>string.hE<gt>\n"
2005 "#include E<lt>sys/socket.hE<gt>\n"
2006 "#include E<lt>sys/types.hE<gt>\n"
2007 "#include E<lt>unistd.hE<gt>\n"
2008 "\\&\n"
2009 "#define BUF_SIZE 500\n"
2010 "\\&\n"
2011 "int\n"
2012 "main(int argc, char *argv[])\n"
2013 "{\n"
2014 " int sfd, s;\n"
2015 " char buf[BUF_SIZE];\n"
2016 " size_t size;\n"
2017 " ssize_t nread;\n"
2018 " struct addrinfo hints;\n"
2019 " struct addrinfo *result, *rp;\n"
2020 "\\&\n"
2021 " if (argc E<lt> 3) {\n"
2022 " fprintf(stderr, \"Usage: %s host port msg...\\[rs]n\", argv[0]);\n"
2023 " exit(EXIT_FAILURE);\n"
2024 " }\n"
2025 "\\&\n"
2026 " /* Obtain address(es) matching host/port. */\n"
2027 "\\&\n"
2028 " memset(&hints, 0, sizeof(hints));\n"
2029 " hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */\n"
2030 " hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */\n"
2031 " hints.ai_flags = 0;\n"
2032 " hints.ai_protocol = 0; /* Any protocol */\n"
2033 "\\&\n"
2034 " s = getaddrinfo(argv[1], argv[2], &hints, &result);\n"
2035 " if (s != 0) {\n"
2036 " fprintf(stderr, \"getaddrinfo: %s\\[rs]n\", gai_strerror(s));\n"
2037 " exit(EXIT_FAILURE);\n"
2038 " }\n"
2039 "\\&\n"
2040 " /* getaddrinfo() returns a list of address structures.\n"
2041 " Try each address until we successfully connect(2).\n"
2042 " If socket(2) (or connect(2)) fails, we (close the socket\n"
2043 " and) try the next address. */\n"
2044 "\\&\n"
2045 " for (rp = result; rp != NULL; rp = rp-E<gt>ai_next) {\n"
2046 " sfd = socket(rp-E<gt>ai_family, rp-E<gt>ai_socktype,\n"
2047 " rp-E<gt>ai_protocol);\n"
2048 " if (sfd == -1)\n"
2049 " continue;\n"
2050 "\\&\n"
2051 " if (connect(sfd, rp-E<gt>ai_addr, rp-E<gt>ai_addrlen) != -1)\n"
2052 " break; /* Success */\n"
2053 "\\&\n"
2054 " close(sfd);\n"
2055 " }\n"
2056 "\\&\n"
2057 " freeaddrinfo(result); /* No longer needed */\n"
2058 "\\&\n"
2059 " if (rp == NULL) { /* No address succeeded */\n"
2060 " fprintf(stderr, \"Could not connect\\[rs]n\");\n"
2061 " exit(EXIT_FAILURE);\n"
2062 " }\n"
2063 "\\&\n"
2064 " /* Send remaining command-line arguments as separate\n"
2065 " datagrams, and read responses from server. */\n"
2066 "\\&\n"
2067 " for (size_t j = 3; j E<lt> argc; j++) {\n"
2068 " size = strlen(argv[j]) + 1;\n"
2069 " /* +1 for terminating null byte */\n"
2070 "\\&\n"
2071 " if (size E<gt> BUF_SIZE) {\n"
2072 " fprintf(stderr,\n"
2073 " \"Ignoring long message in argument %zu\\[rs]n\", j);\n"
2074 " continue;\n"
2075 " }\n"
2076 "\\&\n"
2077 " if (write(sfd, argv[j], size) != size) {\n"
2078 " fprintf(stderr, \"partial/failed write\\[rs]n\");\n"
2079 " exit(EXIT_FAILURE);\n"
2080 " }\n"
2081 "\\&\n"
2082 " nread = read(sfd, buf, BUF_SIZE);\n"
2083 " if (nread == -1) {\n"
2084 " perror(\"read\");\n"
2085 " exit(EXIT_FAILURE);\n"
2086 " }\n"
2087 "\\&\n"
2088 " printf(\"Received %zd bytes: %s\\[rs]n\", nread, buf);\n"
2089 " }\n"
2090 "\\&\n"
2091 " exit(EXIT_SUCCESS);\n"
2092 "}\n"
2093 msgstr ""
2094 "#include E<lt>netdb.hE<gt>\n"
2095 "#include E<lt>stdio.hE<gt>\n"
2096 "#include E<lt>stdlib.hE<gt>\n"
2097 "#include E<lt>string.hE<gt>\n"
2098 "#include E<lt>sys/socket.hE<gt>\n"
2099 "#include E<lt>sys/types.hE<gt>\n"
2100 "#include E<lt>unistd.hE<gt>\n"
2101 "\\&\n"
2102 "#define BUF_SIZE 500\n"
2103 "\\&\n"
2104 "int\n"
2105 "main(int argc, char *argv[])\n"
2106 "{\n"
2107 " int sfd, s;\n"
2108 " char buf[BUF_SIZE];\n"
2109 " size_t size;\n"
2110 " ssize_t nread;\n"
2111 " struct addrinfo hints;\n"
2112 " struct addrinfo *result, *rp;\n"
2113 "\\&\n"
2114 " if (argc E<lt> 3) {\n"
2115 " fprintf(stderr, \"Użycie: %s stacja port komunik...\\[rs]n\", argv[0]);\n"
2116 " exit(EXIT_FAILURE);\n"
2117 " }\n"
2118 "\\&\n"
2119 " /* Pozyskuje adres(y) pasującej stacji/portu. */\n"
2120 "\\&\n"
2121 " memset(&hints, 0, sizeof(hints));\n"
2122 " hints.ai_family = AF_UNSPEC; /* Zezwala na IPv4 lub IPv6 */\n"
2123 " hints.ai_socktype = SOCK_DGRAM; /* Gniazdo datagramowe */\n"
2124 " hints.ai_flags = 0;\n"
2125 " hints.ai_protocol = 0; /* Dowolny protokół */\n"
2126 "\\&\n"
2127 " s = getaddrinfo(argv[1], argv[2], &hints, &result);\n"
2128 " if (s != 0) {\n"
2129 " fprintf(stderr, \"getaddrinfo: %s\\[rs]n\", gai_strerror(s));\n"
2130 " exit(EXIT_FAILURE);\n"
2131 " }\n"
2132 "\\&\n"
2133 " /* getaddrinfo() zwraca listę struktur adresów. Próbuje\n"
2134 " każdego adresu, do pomyślnego połączenia (connect(2)).\n"
2135 " Jeśli socket(2) (lub connect(2)) zawiedzie, (zamykamy\n"
2136 " gniazdo i) próbujemy następny adres. */\n"
2137 "\\&\n"
2138 " for (rp = result; rp != NULL; rp = rp-E<gt>ai_next) {\n"
2139 " sfd = socket(rp-E<gt>ai_family, rp-E<gt>ai_socktype,\n"
2140 " rp-E<gt>ai_protocol);\n"
2141 " if (sfd == -1)\n"
2142 " continue;\n"
2143 "\\&\n"
2144 " if (connect(sfd, rp-E<gt>ai_addr, rp-E<gt>ai_addrlen) != -1)\n"
2145 " break; /* Powodzenie */\n"
2146 "\\&\n"
2147 " close(sfd);\n"
2148 " }\n"
2149 "\\&\n"
2150 " freeaddrinfo(result); /* Nie jest już potrzebne */\n"
2151 "\\&\n"
2152 " if (rp == NULL) { /* Nie udało się z żadnym adresem */\n"
2153 " fprintf(stderr, \"Nie udało się połączyć\\[rs]n\");\n"
2154 " exit(EXIT_FAILURE);\n"
2155 " }\n"
2156 "\\&\n"
2157 " /* Wysyła pozostałe argumenty wiersza poleceń jako oddzielne\n"
2158 " datagramy i odczytuje odpowiedzi z serwera. */\n"
2159 "\\&\n"
2160 " for (size_t j = 3; j E<lt> argc; j++) {\n"
2161 " size = strlen(argv[j]) + 1;\n"
2162 " /* +1 dla końcowego bajtu null */\n"
2163 "\\&\n"
2164 " if (size E<gt> BUF_SIZE) {\n"
2165 " fprintf(stderr,\n"
2166 " \"Ignorowanie długiego komunikatu w argumencie %zu\\[rs]n\", j);\n"
2167 " continue;\n"
2168 " }\n"
2169 "\\&\n"
2170 " if (write(sfd, argv[j], size) != size) {\n"
2171 " fprintf(stderr, \"częściowy/nieudany zapis\\[rs]n\");\n"
2172 " exit(EXIT_FAILURE);\n"
2173 " }\n"
2174 "\\&\n"
2175 " nread = read(sfd, buf, BUF_SIZE);\n"
2176 " if (nread == -1) {\n"
2177 " perror(\"read\");\n"
2178 " exit(EXIT_FAILURE);\n"
2179 " }\n"
2180 "\\&\n"
2181 " printf(\"Otrzymano %zd bajtów: %s\\[rs]n\", nread, buf);\n"
2182 " }\n"
2183 "\\&\n"
2184 " exit(EXIT_SUCCESS);\n"
2185 "}\n"
2186
2187 #. type: TH
2188 #: mageia-cauldron
2189 #, no-wrap
2190 msgid "Linux man-pages 6.17"
2191 msgstr "Linux man-pages 6.17"
2192
2193 #. type: TH
2194 #: opensuse-leap-16-1 opensuse-tumbleweed
2195 #, no-wrap
2196 msgid "Linux man-pages (unreleased)"
2197 msgstr "Linux man-pages (niewydane)"
2198
2199 #. .BR getipnodebyaddr (3),
2200 #. .BR getipnodebyname (3),
2201 #. type: Plain text
2202 #: opensuse-leap-16-1 opensuse-tumbleweed
2203 msgid ""
2204 "B<getaddrinfo_a>(3), B<gethostbyname>(3), B<getnameinfo>(3), B<gai.conf>(5), "
2205 "B<inet>(3), B<gai.conf>(5), B<hostname>(7), B<ip>(7)"
2206 msgstr ""
2207 "B<getaddrinfo_a>(3), B<gethostbyname>(3), B<getnameinfo>(3), B<gai.conf>(5), "
2208 "B<inet>(3), B<gai.conf>(5), B<hostname>(7), B<ip>(7)"