Debian Codegraph @

po/ru/man3/getaddrinfo.3.po

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