# Russian translation of manpages # This file is distributed under the same license as the manpages-l10n package. # Copyright © of this file: # Azamat Hackimov , 2013-2014, 2017. # Dmitry Bolkhovskikh , 2017. # Vladislav , 2015. # Yuri Kozlov , 2011-2019. # Иван Павлов , 2017, 2019. msgid "" msgstr "" "Project-Id-Version: manpages-l10n\n" "POT-Creation-Date: 2024-03-01 16:56+0100\n" "PO-Revision-Date: 2019-10-05 08:06+0300\n" "Last-Translator: Yuri Kozlov \n" "Language-Team: Russian \n" "Language: ru\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " "n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || " "(n%100>=11 && n%100<=14)? 2 : 3);\n" "X-Generator: Lokalize 2.0\n" #. type: TH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "getaddrinfo_a" msgstr "" #. type: TH #: archlinux fedora-40 fedora-rawhide mageia-cauldron #, no-wrap msgid "2023-10-31" msgstr "31 октября 2023 г." #. type: TH #: archlinux fedora-40 fedora-rawhide mageia-cauldron #, no-wrap msgid "Linux man-pages 6.06" msgstr "Linux man-pages 6.06" #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "NAME" msgstr "ИМЯ" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "getaddrinfo_a, gai_suspend, gai_error, gai_cancel - asynchronous network " "address and service translation" msgstr "" "getaddrinfo_a, gai_suspend, gai_error, gai_cancel - асинхронная трансляция " "сетевого адреса и службы" #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "LIBRARY" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "Asynchronous name lookup library (I, I<-lanl>)" msgstr "" #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "SYNOPSIS" msgstr "СИНТАКСИС" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "" "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n" "B<#include Enetdb.hE>\n" msgstr "" "B<#define _GNU_SOURCE> /* См. feature_test_macros(7) */\n" "B<#include Enetdb.hE>\n" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "" #| "BIB<, int >IB<,>\n" #| "B< const struct timespec *>IB<);>\n" msgid "" "BIB<, struct gaicb *>IB<[restrict],>\n" "B< int >IB<, struct sigevent *restrict >IB<);>\n" "BIB<[], int >IB<,>\n" "B< const struct timespec *>IB<);>\n" msgstr "" "BIB<, int >IB<,>\n" "B< const struct timespec *>IB<);>\n" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "BIB<);>\n" msgid "" "BIB<);>\n" "BIB<);>\n" msgstr "BIB<);>\n" #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "DESCRIPTION" msgstr "ОПИСАНИЕ" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The B() function performs the same task as " "B(3), but allows multiple name look-ups to be performed " "asynchronously, with optional notification on completion of look-up " "operations." msgstr "" "Функция B() выполняет ту же задачу что и B(3), " "но позволяет выполнять поиск нескольких имён асинхронно, с дополнительным " "уведомлением о завершении операций поиска." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "The I argument has one of the following values:" msgstr "В аргументе I указывается одно из следующих значений:" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Perform the look-ups synchronously. The call blocks until the look-ups have " "completed." msgstr "" "Выполнять поиск синхронно. Вызов блокирует выполнение пока поиск не " "завершится." #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Perform the look-ups asynchronously. The call returns immediately, and the " "requests are resolved in the background. See the discussion of the I " "argument below." msgstr "" "Выполнять поиск асинхронно. Вызов сразу завершается и запросы обрабатываются " "в фоновом режиме. Смотрите далее описание параметра I." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The array I specifies the look-up requests to process. The I " "argument specifies the number of elements in I. The requested look-up " "operations are started in parallel. NULL elements in I are ignored. " "Each request is described by a I structure, defined as follows:" msgstr "" "В массиве I задаются запросы на обработку. В аргументе I " "задаётся количество элементов в I. Запрашиваемые операции поиска " "начинаются параллельно. Элементы NULL в списке I игнорируются. Каждый " "запрос описывается структурой I, которая определена следующим образом:" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "" "struct gaicb {\n" " const char *ar_name;\n" " const char *ar_service;\n" " const struct addrinfo *ar_request;\n" " struct addrinfo *ar_result;\n" "};\n" msgstr "" "struct gaicb {\n" " const char *ar_name;\n" " const char *ar_service;\n" " const struct addrinfo *ar_request;\n" " struct addrinfo *ar_result;\n" "};\n" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The elements of this structure correspond to the arguments of " "B(3). Thus, I corresponds to the I argument and " "I to the I argument, identifying an Internet host and a " "service. The I element corresponds to the I argument, " "specifying the criteria for selecting the returned socket address " "structures. Finally, I corresponds to the I argument; you " "do not need to initialize this element, it will be automatically set when " "the request is resolved. The I structure referenced by the last " "two elements is described in B(3)." msgstr "" "Элементы данной структуры совпадают с аргументами B(3). То есть " "I соответствует аргументу I, а I аргументу " "I (определяют узел Интернета и службу). Элемент I " "соответствует аргументу I; им задаётся критерий выбора структуры " "возвращаемого адреса сокета. И, наконец, I соответствует " "аргументу I; вам не нужно инициализировать этот элемент, он будет " "заполнен автоматически в результате запроса. Структура I, на " "которую ссылаются последние два элемента, описана в B(3)." #. type: Plain text #: archlinux fedora-40 fedora-rawhide mageia-cauldron #, fuzzy #| msgid "" #| "When I is specified as B, notifications about resolved " #| "requests can be obtained by employing the I structure pointed " #| "to by the I argument. For the definition and general details of " #| "this structure, see B(7). The Isigev_notify> field " #| "can have the following values:" msgid "" "When I is specified as B, notifications about resolved " "requests can be obtained by employing the I structure pointed to " "by the I argument. For the definition and general details of this " "structure, see B(3type). The Isigev_notify> field can " "have the following values:" msgstr "" "Если значение I равно B, то уведомления о обработанных " "запросах можно получить из структуры I, на которую указывает " "аргумент I. Определение и описание данной структуры приведено в " "B(7). Поле Isigev_notify> может иметь следующие " "значения:" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "Don't provide any notification." msgstr "Отключить уведомление." #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. si_pid and si_uid are also set, to the values of the calling process, #. which doesn't provide useful information, so we'll skip mentioning it. #. type: Plain text #: archlinux fedora-40 fedora-rawhide mageia-cauldron #, fuzzy #| msgid "" #| "When a look-up completes, generate the signal I for the " #| "process. See B(7) for general details. The I field " #| "of the I structure will be set to B." msgid "" "When a look-up completes, generate the signal I for the " "process. See B(3type) for general details. The I field " "of the I structure will be set to B." msgstr "" "При завершении поиска послать процессу сигнал I. Подробности " "смотрите в B(7). Полю I структуры I " "присваивается значение B." #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux fedora-40 fedora-rawhide mageia-cauldron #, fuzzy #| msgid "" #| "When a look-up completes, invoke I as if it were " #| "the start function of a new thread. See B(7) for details." msgid "" "When a look-up completes, invoke I as if it were the " "start function of a new thread. See B(3type) for details." msgstr "" "При завершении поиска вызвать I, как если бы с этой " "функции начиналась бы новая нить. Подробности смотрите в B(7)." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "For B and B, it may be useful to point Isigev_value.sival_ptr> to I." msgstr "" "При B и B, может быть полезно, чтобы Isigev_value.sival_ptr> указывала на I." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The B() function suspends execution of the calling thread, " "waiting for the completion of one or more requests in the array I. " "The I argument specifies the size of the array I. The call " "blocks until one of the following occurs:" msgstr "" "Функция B() приостанавливает выполнение вызывающей нити, ожидая " "завершения поиска одного или более запросов из массива I. В аргументе " "I задаётся размер массива I. Вызов блокирует выполнение пока " "не произойдёт одно из следующего:" #. type: IP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "\\[bu]" msgstr "\\[bu]" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "One or more of the operations in I completes." msgstr "Завершится операция для одного или более запросов из I." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "The call is interrupted by a signal that is caught." msgstr "Вызов прервётся пойманным сигналом." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The time interval specified in I elapses. This argument specifies " "a timeout in seconds plus nanoseconds (see B(2) for details of " "the I structure). If I is NULL, then the call blocks " "indefinitely (until one of the events above occurs)." msgstr "" "Временной интервал ожидания задаётся в I. В данном аргумента " "указывается промежуток в секундах плюс наносекундах (о структуре " "I смотрите B(2)). Если I равно NULL, то вызов " "блокирует выполнение навсегда (пока не произойдёт одно из событий выше)." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "No explicit indication of which request was completed is given; you must " "determine which request(s) have completed by iterating with B() " "over the list of requests." msgstr "" "При выполнении явно не указывается какие запросы завершены; для определения " "вам нужно обойти весь список запросов с помощью B()." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The B() function returns the status of the request I: " "either B if the request was not completed yet, 0 if it was " "handled successfully, or an error code if the request could not be resolved." msgstr "" "Функция B() возвращает состояние запроса I: " "B — запрос пока не выполнен, 0 — обработан успешно, код " "ошибки — запрос невозможно обработать." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The B() function cancels the request I. If the request " "has been canceled successfully, the error status of the request will be set " "to B and normal asynchronous notification will be performed. " "The request cannot be canceled if it is currently being processed; in that " "case, it will be handled as if B() has never been called. If " "I is NULL, an attempt is made to cancel all outstanding requests that " "the process has made." msgstr "" "Функция B() отменяет запрос I. При успешной отмене " "состояние ошибки устанавливается в B и выполняется обычное " "асинхронное уведомление. Запрос не может быть отменён, если он начал " "обрабатываться; в этом случае действие будет доведено до конца, как если бы " "вызова B() не происходило. Если I равно NULL, то будет " "предпринята попытка отменить все имеющиеся запросы." #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "RETURN VALUE" msgstr "ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The B() function returns 0 if all of the requests have been " "enqueued successfully, or one of the following nonzero error codes:" msgstr "" "Функция B() возвращает 0, если все запросы были успешно " "обработаны или один из следующих ненулевых кодов ошибки:" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The resources necessary to enqueue the look-up requests were not available. " "The application may check the error status of each request to determine " "which ones failed." msgstr "" "Недоступны ресурсы, необходимые, чтобы постановки запросов поиска в очередь. " "Для нахождения проблемного приложение может проверить состояние ошибки " "каждого запроса." #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "Out of memory." msgstr "Не хватает памяти." #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "I is invalid." msgstr "Неверное значение I." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The B() function returns 0 if at least one of the listed " "requests has been completed. Otherwise, it returns one of the following " "nonzero error codes:" msgstr "" "Функция B() возвращает 0, если завершён хотя бы один из " "запросов. В противном случае возвращается один из следующих ненулевых кодов " "ошибки:" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The given timeout expired before any of the requests could be completed." msgstr "Указанный интервал истёк до завершения хотят бы одного из запросов." #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "There were no actual requests given to the function." msgstr "В функцию не было передано никаких фактических запросов." #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "A signal has interrupted the function. Note that this interruption might " "have been caused by signal notification of some completed look-up request." msgstr "" "Функция прервана сигналом. Заметим, что такое прерывание может быть вызвано " "сигналом уведомления о каком-то выполненном запросе." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The B() function can return B for an unfinished " "look-up request, 0 for a successfully completed look-up (as described " "above), one of the error codes that could be returned by B(3), " "or the error code B if the request has been canceled " "explicitly before it could be finished." msgstr "" "Функция B() может вернуть B для незаконченных " "запросов поиска, 0 при успешном поиске (как описано выше), один из кодов " "ошибок, которые может вернуть B(3) или код ошибки " "B, если запрос был отменён явно до завершения." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "The B() function can return one of these values:" msgstr "Функция B() может вернуть одно из следующих значений:" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "The request has been canceled successfully." msgstr "Запрос успешно отменён." #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "The request has not been canceled." msgstr "Запрос не был отменён." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "The request has already completed." msgstr "Запрос уже выполнен." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The B(3) function translates these error codes to a human " "readable string, suitable for error reporting." msgstr "" "Функция B(3) транслирует эти коды ошибок в читаемый формат, " "подходящий для сообщений об ошибке." #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "ATTRIBUTES" msgstr "АТРИБУТЫ" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "For an explanation of the terms used in this section, see B(7)." msgstr "Описание терминов данного раздела смотрите в B(7)." #. type: tbl table #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Interface" msgstr "Интерфейс" #. type: tbl table #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Attribute" msgstr "Атрибут" #. type: tbl table #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Value" msgstr "Значение" #. type: tbl table #: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron #: opensuse-tumbleweed #, no-wrap msgid ".na\n" msgstr ".na\n" #. type: tbl table #: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron #: opensuse-tumbleweed #, no-wrap msgid ".nh\n" msgstr ".nh\n" #. type: tbl table #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "" "B(),\n" "B(),\n" "B(),\n" "B()" msgstr "" "B(),\n" "B(),\n" "B(),\n" "B()" #. type: tbl table #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Thread safety" msgstr "Безвредность в нитях" #. type: tbl table #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "MT-Safe" msgstr "MT-Safe" #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "STANDARDS" msgstr "СТАНДАРТЫ" #. type: Plain text #: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron #: opensuse-leap-15-6 opensuse-tumbleweed msgid "GNU." msgstr "GNU." #. type: SH #: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron #: opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "HISTORY" msgstr "ИСТОРИЯ" #. type: Plain text #: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron #: opensuse-leap-15-6 opensuse-tumbleweed #, fuzzy #| msgid "Since glibc 2.2.2:" msgid "glibc 2.2.3." msgstr "Начиная с glibc 2.2.2:" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The interface of B() was modeled after the B(3) " "interface." msgstr "" "Интерфейс B() был создан после интерфейса B(3)." #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "EXAMPLES" msgstr "ПРИМЕРЫ" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Two examples are provided: a simple example that resolves several requests " "in parallel synchronously, and a complex example showing some of the " "asynchronous capabilities." msgstr "" "Вот два примера: простой пример выполнения нескольких запросов синхронно " "одновременно, и сложный пример, показывающий асинхронные возможности." #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Synchronous example" msgstr "Синхронный пример" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The program below simply resolves several hostnames in parallel, giving a " "speed-up compared to resolving the hostnames sequentially using " "B(3). The program might be used like this:" msgstr "" "Эта программа определяет несколько имён узлов параллельно, что быстрее по " "сравнению с определением имён последовательно с помощью B(3). " "Результат работы программы:" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "" #| "$ B<./a.out ftp.us.kernel.org enoent.linuxfoundation.org gnu.cz>\n" #| "ftp.us.kernel.org: 128.30.2.36\n" #| "enoent.linuxfoundation.org: Name or service not known\n" #| "gnu.cz: 87.236.197.13\n" msgid "" "$ B<./a.out mirrors.kernel.org enoent.linuxfoundation.org gnu.org>\n" "mirrors.kernel.org: 139.178.88.99\n" "enoent.linuxfoundation.org: Name or service not known\n" "gnu.org: 209.51.188.116\n" msgstr "" "$ B<./a.out ftp.us.kernel.org enoent.linuxfoundation.org gnu.cz>\n" "ftp.us.kernel.org: 128.30.2.36\n" "enoent.linuxfoundation.org: Name or service not known\n" "gnu.cz: 87.236.197.13\n" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "Here is the program source code" msgstr "Исходный код программы" #. type: Plain text #: archlinux fedora-40 fedora-rawhide mageia-cauldron #, no-wrap msgid "" "#define _GNU_SOURCE\n" "#include Eerr.hE\n" "#include Enetdb.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Estring.hE\n" "\\&\n" "#define MALLOC(n, type) ((type *) reallocarray(NULL, n, sizeof(type)))\n" "\\&\n" "int\n" "main(int argc, char *argv[])\n" "{\n" " int ret;\n" " struct gaicb *reqs[argc - 1];\n" " char host[NI_MAXHOST];\n" " struct addrinfo *res;\n" "\\&\n" " if (argc E 2) {\n" " fprintf(stderr, \"Usage: %s HOST...\\en\", argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " for (size_t i = 0; i E argc - 1; i++) {\n" " reqs[i] = MALLOC(1, struct gaicb);\n" " if (reqs[i] == NULL)\n" " err(EXIT_FAILURE, \"malloc\");\n" "\\&\n" " memset(reqs[i], 0, sizeof(*reqs[0]));\n" " reqs[i]-Ear_name = argv[i + 1];\n" " }\n" "\\&\n" " ret = getaddrinfo_a(GAI_WAIT, reqs, argc - 1, NULL);\n" " if (ret != 0) {\n" " fprintf(stderr, \"getaddrinfo_a() failed: %s\\en\",\n" " gai_strerror(ret));\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " for (size_t i = 0; i E argc - 1; i++) {\n" " printf(\"%s: \", reqs[i]-Ear_name);\n" " ret = gai_error(reqs[i]);\n" " if (ret == 0) {\n" " res = reqs[i]-Ear_result;\n" "\\&\n" " ret = getnameinfo(res-Eai_addr, res-Eai_addrlen,\n" " host, sizeof(host),\n" " NULL, 0, NI_NUMERICHOST);\n" " if (ret != 0) {\n" " fprintf(stderr, \"getnameinfo() failed: %s\\en\",\n" " gai_strerror(ret));\n" " exit(EXIT_FAILURE);\n" " }\n" " puts(host);\n" "\\&\n" " } else {\n" " puts(gai_strerror(ret));\n" " }\n" " }\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" #. SRC END #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Asynchronous example" msgstr "Асинхронный пример" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "This example shows a simple interactive B() front-end. The " "notification facility is not demonstrated." msgstr "" "Данный пример — простая интерактивная оболочка к B(). " "Возможности уведомления не используются." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "An example session might look like this:" msgstr "Результат работы программы:" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "" #| "$ B<./a.out>\n" #| "E a ftp.us.kernel.org enoent.linuxfoundation.org gnu.cz\n" #| "E c 2\n" #| "[2] gnu.cz: Request not canceled\n" #| "E w 0 1\n" #| "[00] ftp.us.kernel.org: Finished\n" #| "E l\n" #| "[00] ftp.us.kernel.org: 216.165.129.139\n" #| "[01] enoent.linuxfoundation.org: Processing request in progress\n" #| "[02] gnu.cz: 87.236.197.13\n" #| "E l\n" #| "[00] ftp.us.kernel.org: 216.165.129.139\n" #| "[01] enoent.linuxfoundation.org: Name or service not known\n" #| "[02] gnu.cz: 87.236.197.13\n" msgid "" "$ B<./a.out>\n" "E a mirrors.kernel.org enoent.linuxfoundation.org gnu.org\n" "E c 2\n" "[2] gnu.org: Request not canceled\n" "E w 0 1\n" "[00] mirrors.kernel.org: Finished\n" "E l\n" "[00] mirrors.kernel.org: 139.178.88.99\n" "[01] enoent.linuxfoundation.org: Processing request in progress\n" "[02] gnu.org: 209.51.188.116\n" "E l\n" "[00] mirrors.kernel.org: 139.178.88.99\n" "[01] enoent.linuxfoundation.org: Name or service not known\n" "[02] gnu.org: 209.51.188.116\n" msgstr "" "$ B<./a.out>\n" "E a ftp.us.kernel.org enoent.linuxfoundation.org gnu.cz\n" "E c 2\n" "[2] gnu.cz: Request not canceled\n" "E w 0 1\n" "[00] ftp.us.kernel.org: Выполнено\n" "E l\n" "[00] ftp.us.kernel.org: 216.165.129.139\n" "[01] enoent.linuxfoundation.org: Processing request in progress\n" "[02] gnu.cz: 87.236.197.13\n" "E l\n" "[00] ftp.us.kernel.org: 216.165.129.139\n" "[01] enoent.linuxfoundation.org: Name or service not known\n" "[02] gnu.cz: 87.236.197.13\n" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "The program source is as follows:" msgstr "Исходный код программы:" #. type: Plain text #: archlinux fedora-40 fedora-rawhide mageia-cauldron #, no-wrap msgid "" "#define _GNU_SOURCE\n" "#include Eassert.hE\n" "#include Eerr.hE\n" "#include Enetdb.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Estring.hE\n" "\\&\n" "#define CALLOC(n, type) ((type *) calloc(n, sizeof(type)))\n" "\\&\n" "#define REALLOCF(ptr, n, type) \\e\n" "({ \\e\n" " static_assert(__builtin_types_compatible_p(typeof(ptr), type *)); \\e\n" " \\e\n" " (type *) reallocarrayf(ptr, n, sizeof(type)); \\e\n" "})\n" "\\&\n" "static struct gaicb **reqs = NULL;\n" "static size_t nreqs = 0;\n" "\\&\n" "static inline void *\n" "reallocarrayf(void *p, size_t nmemb, size_t size)\n" "{\n" " void *q;\n" "\\&\n" " q = reallocarray(p, nmemb, size);\n" " if (q == NULL && nmemb != 0 && size != 0)\n" " free(p);\n" " return q;\n" "}\n" "\\&\n" "static char *\n" "getcmd(void)\n" "{\n" " static char buf[256];\n" "\\&\n" " fputs(\"E \", stdout); fflush(stdout);\n" " if (fgets(buf, sizeof(buf), stdin) == NULL)\n" " return NULL;\n" "\\&\n" " if (buf[strlen(buf) - 1] == \\[aq]\\en\\[aq])\n" " buf[strlen(buf) - 1] = 0;\n" "\\&\n" " return buf;\n" "}\n" "\\&\n" "/* Add requests for specified hostnames. */\n" "static void\n" "add_requests(void)\n" "{\n" " size_t nreqs_base = nreqs;\n" " char *host;\n" " int ret;\n" "\\&\n" " while ((host = strtok(NULL, \" \"))) {\n" " nreqs++;\n" " reqs = REALLOCF(reqs, nreqs, struct gaicb *);\n" " if (reqs == NULL)\n" " err(EXIT_FAILURE, \"reallocf\");\n" "\\&\n" " reqs[nreqs - 1] = CALLOC(1, struct gaicb);\n" " if (reqs[nreqs - 1] == NULL)\n" " err(EXIT_FAILURE, \"calloc\");\n" "\\&\n" " reqs[nreqs - 1]-Ear_name = strdup(host);\n" " }\n" "\\&\n" " /* Queue nreqs_base..nreqs requests. */\n" "\\&\n" " ret = getaddrinfo_a(GAI_NOWAIT, &reqs[nreqs_base],\n" " nreqs - nreqs_base, NULL);\n" " if (ret) {\n" " fprintf(stderr, \"getaddrinfo_a() failed: %s\\en\",\n" " gai_strerror(ret));\n" " exit(EXIT_FAILURE);\n" " }\n" "}\n" "\\&\n" "/* Wait until at least one of specified requests completes. */\n" "static void\n" "wait_requests(void)\n" "{\n" " char *id;\n" " int ret;\n" " size_t n;\n" " struct gaicb const **wait_reqs;\n" "\\&\n" " wait_reqs = CALLOC(nreqs, const struct gaicb *);\n" " if (wait_reqs == NULL)\n" " err(EXIT_FAILURE, \"calloc\");\n" "\\&\n" " /* NULL elements are ignored by gai_suspend(). */\n" "\\&\n" " while ((id = strtok(NULL, \" \")) != NULL) {\n" " n = atoi(id);\n" "\\&\n" " if (n E= nreqs) {\n" " printf(\"Bad request number: %s\\en\", id);\n" " return;\n" " }\n" "\\&\n" " wait_reqs[n] = reqs[n];\n" " }\n" "\\&\n" " ret = gai_suspend(wait_reqs, nreqs, NULL);\n" " if (ret) {\n" " printf(\"gai_suspend(): %s\\en\", gai_strerror(ret));\n" " return;\n" " }\n" "\\&\n" " for (size_t i = 0; i E nreqs; i++) {\n" " if (wait_reqs[i] == NULL)\n" " continue;\n" "\\&\n" " ret = gai_error(reqs[i]);\n" " if (ret == EAI_INPROGRESS)\n" " continue;\n" "\\&\n" " printf(\"[%02zu] %s: %s\\en\", i, reqs[i]-Ear_name,\n" " ret == 0 ? \"Finished\" : gai_strerror(ret));\n" " }\n" "}\n" "\\&\n" "/* Cancel specified requests. */\n" "static void\n" "cancel_requests(void)\n" "{\n" " char *id;\n" " int ret;\n" " size_t n;\n" "\\&\n" " while ((id = strtok(NULL, \" \")) != NULL) {\n" " n = atoi(id);\n" "\\&\n" " if (n E= nreqs) {\n" " printf(\"Bad request number: %s\\en\", id);\n" " return;\n" " }\n" "\\&\n" " ret = gai_cancel(reqs[n]);\n" " printf(\"[%s] %s: %s\\en\", id, reqs[atoi(id)]-Ear_name,\n" " gai_strerror(ret));\n" " }\n" "}\n" "\\&\n" "/* List all requests. */\n" "static void\n" "list_requests(void)\n" "{\n" " int ret;\n" " char host[NI_MAXHOST];\n" " struct addrinfo *res;\n" "\\&\n" " for (size_t i = 0; i E nreqs; i++) {\n" " printf(\"[%02zu] %s: \", i, reqs[i]-Ear_name);\n" " ret = gai_error(reqs[i]);\n" "\\&\n" " if (!ret) {\n" " res = reqs[i]-Ear_result;\n" "\\&\n" " ret = getnameinfo(res-Eai_addr, res-Eai_addrlen,\n" " host, sizeof(host),\n" " NULL, 0, NI_NUMERICHOST);\n" " if (ret) {\n" " fprintf(stderr, \"getnameinfo() failed: %s\\en\",\n" " gai_strerror(ret));\n" " exit(EXIT_FAILURE);\n" " }\n" " puts(host);\n" " } else {\n" " puts(gai_strerror(ret));\n" " }\n" " }\n" "}\n" "\\&\n" "int\n" "main(void)\n" "{\n" " char *cmdline;\n" " char *cmd;\n" "\\&\n" " while ((cmdline = getcmd()) != NULL) {\n" " cmd = strtok(cmdline, \" \");\n" "\\&\n" " if (cmd == NULL) {\n" " list_requests();\n" " } else {\n" " switch (cmd[0]) {\n" " case \\[aq]a\\[aq]:\n" " add_requests();\n" " break;\n" " case \\[aq]w\\[aq]:\n" " wait_requests();\n" " break;\n" " case \\[aq]c\\[aq]:\n" " cancel_requests();\n" " break;\n" " case \\[aq]l\\[aq]:\n" " list_requests();\n" " break;\n" " default:\n" " fprintf(stderr, \"Bad command: %c\\en\", cmd[0]);\n" " break;\n" " }\n" " }\n" " }\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" #. SRC END #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "SEE ALSO" msgstr "СМ. ТАКЖЕ" #. type: Plain text #: archlinux fedora-40 fedora-rawhide mageia-cauldron #, fuzzy #| msgid "" #| "B(3), B(3), B(3), B(7), " #| "B(7), B(7)" msgid "" "B(3), B(3), B(3), B(7), B(7), " "B(3type)" msgstr "" "B(3), B(3), B(3), B(7), B(7), " "B(7)" #. type: TH #: debian-bookworm #, no-wrap msgid "2023-02-05" msgstr "5 февраля 2023 г." #. type: TH #: debian-bookworm #, no-wrap msgid "Linux man-pages 6.03" msgstr "Linux man-pages 6.03" #. type: Plain text #: debian-bookworm debian-unstable opensuse-leap-15-6 opensuse-tumbleweed msgid "" "When I is specified as B, notifications about resolved " "requests can be obtained by employing the I structure pointed to " "by the I argument. For the definition and general details of this " "structure, see B(7). The Isigev_notify> field can have " "the following values:" msgstr "" "Если значение I равно B, то уведомления о обработанных " "запросах можно получить из структуры I, на которую указывает " "аргумент I. Определение и описание данной структуры приведено в " "B(7). Поле Isigev_notify> может иметь следующие " "значения:" #. si_pid and si_uid are also set, to the values of the calling process, #. which doesn't provide useful information, so we'll skip mentioning it. #. type: Plain text #: debian-bookworm debian-unstable opensuse-leap-15-6 opensuse-tumbleweed msgid "" "When a look-up completes, generate the signal I for the " "process. See B(7) for general details. The I field of " "the I structure will be set to B." msgstr "" "При завершении поиска послать процессу сигнал I. Подробности " "смотрите в B(7). Полю I структуры I " "присваивается значение B." #. type: Plain text #: debian-bookworm debian-unstable opensuse-leap-15-6 opensuse-tumbleweed msgid "" "When a look-up completes, invoke I as if it were the " "start function of a new thread. See B(7) for details." msgstr "" "При завершении поиска вызвать I, как если бы с этой " "функции начиналась бы новая нить. Подробности смотрите в B(7)." #. type: Plain text #: debian-bookworm #, fuzzy #| msgid "" #| "These functions are GNU extensions; they first appeared in glibc in " #| "version 2.2.3." msgid "These functions are GNU extensions; they first appeared in glibc 2.2.3." msgstr "" "Эти функции являются расширениями GNU, доступными в glibc начиная с версии " "2.2.3." #. type: SH #: debian-bookworm #, no-wrap msgid "NOTES" msgstr "ЗАМЕЧАНИЯ" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" "#define _GNU_SOURCE\n" "#include Enetdb.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Estring.hE\n" msgstr "" "#define _GNU_SOURCE\n" "#include Enetdb.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Estring.hE\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid "" #| "int\n" #| "main(int argc, char *argv[])\n" #| "{\n" #| " int i, ret;\n" #| " struct gaicb *reqs[argc - 1];\n" #| " char host[NI_MAXHOST];\n" #| " struct addrinfo *res;\n" msgid "" "int\n" "main(int argc, char *argv[])\n" "{\n" " int ret;\n" " struct gaicb *reqs[argc - 1];\n" " char host[NI_MAXHOST];\n" " struct addrinfo *res;\n" msgstr "" "int\n" "main(int argc, char *argv[])\n" "{\n" " int i, ret;\n" " struct gaicb *reqs[argc - 1];\n" " char host[NI_MAXHOST];\n" " struct addrinfo *res;\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " if (argc E 2) {\n" " fprintf(stderr, \"Usage: %s HOST...\\en\", argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" msgstr "" " if (argc E 2) {\n" " fprintf(stderr, \"Использование: %s УЗЕЛ...\\en\", argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid "" #| " for (i = 0; i E argc - 1; i++) {\n" #| " reqs[i] = malloc(sizeof(*reqs[0]));\n" #| " if (reqs[i] == NULL) {\n" #| " perror(\"malloc\");\n" #| " exit(EXIT_FAILURE);\n" #| " }\n" #| " memset(reqs[i], 0, sizeof(*reqs[0]));\n" #| " reqs[i]-Ear_name = argv[i + 1];\n" #| " }\n" msgid "" " for (size_t i = 0; i E argc - 1; i++) {\n" " reqs[i] = malloc(sizeof(*reqs[0]));\n" " if (reqs[i] == NULL) {\n" " perror(\"malloc\");\n" " exit(EXIT_FAILURE);\n" " }\n" " memset(reqs[i], 0, sizeof(*reqs[0]));\n" " reqs[i]-Ear_name = argv[i + 1];\n" " }\n" msgstr "" " for (i = 0; i E argc - 1; i++) {\n" " reqs[i] = malloc(sizeof(*reqs[0]));\n" " if (reqs[i] == NULL) {\n" " perror(\"malloc\");\n" " exit(EXIT_FAILURE);\n" " }\n" " memset(reqs[i], 0, sizeof(*reqs[0]));\n" " reqs[i]-Ear_name = argv[i + 1];\n" " }\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " ret = getaddrinfo_a(GAI_WAIT, reqs, argc - 1, NULL);\n" " if (ret != 0) {\n" " fprintf(stderr, \"getaddrinfo_a() failed: %s\\en\",\n" " gai_strerror(ret));\n" " exit(EXIT_FAILURE);\n" " }\n" msgstr "" " ret = getaddrinfo_a(GAI_WAIT, reqs, argc - 1, NULL);\n" " if (ret != 0) {\n" " fprintf(stderr, \"ошибка getaddrinfo_a(): %s\\en\",\n" " gai_strerror(ret));\n" " exit(EXIT_FAILURE);\n" " }\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid "" #| " for (i = 0; i E argc - 1; i++) {\n" #| " printf(\"%s: \", reqs[i]-Ear_name);\n" #| " ret = gai_error(reqs[i]);\n" #| " if (ret == 0) {\n" #| " res = reqs[i]-Ear_result;\n" msgid "" " for (size_t i = 0; i E argc - 1; i++) {\n" " printf(\"%s: \", reqs[i]-Ear_name);\n" " ret = gai_error(reqs[i]);\n" " if (ret == 0) {\n" " res = reqs[i]-Ear_result;\n" msgstr "" " for (i = 0; i E argc - 1; i++) {\n" " printf(\"%s: \", reqs[i]-Ear_name);\n" " ret = gai_error(reqs[i]);\n" " if (ret == 0) {\n" " res = reqs[i]-Ear_result;\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid "" #| " ret = getnameinfo(res-Eai_addr, res-Eai_addrlen,\n" #| " host, sizeof(host),\n" #| " NULL, 0, NI_NUMERICHOST);\n" #| " if (ret != 0) {\n" #| " fprintf(stderr, \"getnameinfo() failed: %s\\en\",\n" #| " gai_strerror(ret));\n" #| " exit(EXIT_FAILURE);\n" #| " }\n" #| " puts(host);\n" msgid "" " ret = getnameinfo(res-Eai_addr, res-Eai_addrlen,\n" " host, sizeof(host),\n" " NULL, 0, NI_NUMERICHOST);\n" " if (ret != 0) {\n" " fprintf(stderr, \"getnameinfo() failed: %s\\en\",\n" " gai_strerror(ret));\n" " exit(EXIT_FAILURE);\n" " }\n" " puts(host);\n" msgstr "" " ret = getnameinfo(res-Eai_addr, res-Eai_addrlen,\n" " host, sizeof(host),\n" " NULL, 0, NI_NUMERICHOST);\n" " if (ret != 0) {\n" " fprintf(stderr, \"ошибка getnameinfo(): %s\\en\",\n" " gai_strerror(ret));\n" " exit(EXIT_FAILURE);\n" " }\n" " puts(host);\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " } else {\n" " puts(gai_strerror(ret));\n" " }\n" " }\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" " } else {\n" " puts(gai_strerror(ret));\n" " }\n" " }\n" " exit(EXIT_SUCCESS);\n" "}\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid "" #| "static struct gaicb **reqs = NULL;\n" #| "static int nreqs = 0;\n" msgid "" "static struct gaicb **reqs = NULL;\n" "static size_t nreqs = 0;\n" msgstr "" "static struct gaicb **reqs = NULL;\n" "static int nreqs = 0;\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" "static char *\n" "getcmd(void)\n" "{\n" " static char buf[256];\n" msgstr "" "static char *\n" "getcmd(void)\n" "{\n" " static char buf[256];\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " fputs(\"E \", stdout); fflush(stdout);\n" " if (fgets(buf, sizeof(buf), stdin) == NULL)\n" " return NULL;\n" msgstr "" " fputs(\"E \", stdout); fflush(stdout);\n" " if (fgets(buf, sizeof(buf), stdin) == NULL)\n" " return NULL;\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid "" #| " if (buf[strlen(buf) - 1] == \\(aq\\en\\(aq)\n" #| " buf[strlen(buf) - 1] = 0;\n" msgid "" " if (buf[strlen(buf) - 1] == \\[aq]\\en\\[aq])\n" " buf[strlen(buf) - 1] = 0;\n" msgstr "" " if (buf[strlen(buf) - 1] == \\(aq\\en\\(aq)\n" " buf[strlen(buf) - 1] = 0;\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " return buf;\n" "}\n" msgstr "" " return buf;\n" "}\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid "" #| "/* Add requests for specified hostnames */\n" #| "static void\n" #| "add_requests(void)\n" #| "{\n" #| " int nreqs_base = nreqs;\n" #| " char *host;\n" #| " int ret;\n" msgid "" "/* Add requests for specified hostnames. */\n" "static void\n" "add_requests(void)\n" "{\n" " size_t nreqs_base = nreqs;\n" " char *host;\n" " int ret;\n" msgstr "" "/* добавление запросов задаваемых имён */\n" "static void\n" "add_requests(void)\n" "{\n" " int nreqs_base = nreqs;\n" " char *host;\n" " int ret;\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid "" #| " while ((host = strtok(NULL, \" \"))) {\n" #| " nreqs++;\n" #| " reqs = realloc(reqs, nreqs * sizeof(reqs[0]));\n" msgid "" " while ((host = strtok(NULL, \" \"))) {\n" " nreqs++;\n" " reqs = realloc(reqs, sizeof(reqs[0]) * nreqs);\n" msgstr "" " while ((host = strtok(NULL, \" \"))) {\n" " nreqs++;\n" " reqs = realloc(reqs, nreqs * sizeof(reqs[0]));\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " reqs[nreqs - 1] = calloc(1, sizeof(*reqs[0]));\n" " reqs[nreqs - 1]-Ear_name = strdup(host);\n" " }\n" msgstr "" " reqs[nreqs - 1] = calloc(1, sizeof(*reqs[0]));\n" " reqs[nreqs - 1]-Ear_name = strdup(host);\n" " }\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* Queue nreqs_base..nreqs requests. */\n" msgstr " /* очередь запросов nreqs_base..nreqs. */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " ret = getaddrinfo_a(GAI_NOWAIT, &reqs[nreqs_base],\n" " nreqs - nreqs_base, NULL);\n" " if (ret) {\n" " fprintf(stderr, \"getaddrinfo_a() failed: %s\\en\",\n" " gai_strerror(ret));\n" " exit(EXIT_FAILURE);\n" " }\n" "}\n" msgstr "" " ret = getaddrinfo_a(GAI_NOWAIT, &reqs[nreqs_base],\n" " nreqs - nreqs_base, NULL);\n" " if (ret) {\n" " fprintf(stderr, \"ошибка getaddrinfo_a(): %s\\en\",\n" " gai_strerror(ret));\n" " exit(EXIT_FAILURE);\n" " }\n" "}\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid "" #| "/* Wait until at least one of specified requests completes */\n" #| "static void\n" #| "wait_requests(void)\n" #| "{\n" #| " char *id;\n" #| " int i, ret, n;\n" #| " struct gaicb const **wait_reqs = calloc(nreqs, sizeof(*wait_reqs));\n" #| " /* NULL elements are ignored by gai_suspend(). */\n" msgid "" "/* Wait until at least one of specified requests completes. */\n" "static void\n" "wait_requests(void)\n" "{\n" " char *id;\n" " int ret;\n" " size_t n;\n" " struct gaicb const **wait_reqs = calloc(nreqs, sizeof(*wait_reqs));\n" " /* NULL elements are ignored by gai_suspend(). */\n" msgstr "" "/* ждём, пока один из запросов не выполнится */\n" "static void\n" "wait_requests(void)\n" "{\n" " char *id;\n" " int i, ret, n;\n" " struct gaicb const **wait_reqs = calloc(nreqs, sizeof(*wait_reqs));\n" " /* элементы NULL игнорируются gai_suspend(). */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " while ((id = strtok(NULL, \" \")) != NULL) {\n" " n = atoi(id);\n" msgstr "" " while ((id = strtok(NULL, \" \")) != NULL) {\n" " n = atoi(id);\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " if (n E= nreqs) {\n" " printf(\"Bad request number: %s\\en\", id);\n" " return;\n" " }\n" msgstr "" " if (n E= nreqs) {\n" " printf(\"Неправильный номер запроса: %s\\en\", id);\n" " return;\n" " }\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " wait_reqs[n] = reqs[n];\n" " }\n" msgstr "" " wait_reqs[n] = reqs[n];\n" " }\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " ret = gai_suspend(wait_reqs, nreqs, NULL);\n" " if (ret) {\n" " printf(\"gai_suspend(): %s\\en\", gai_strerror(ret));\n" " return;\n" " }\n" msgstr "" " ret = gai_suspend(wait_reqs, nreqs, NULL);\n" " if (ret) {\n" " printf(\"gai_suspend(): %s\\en\", gai_strerror(ret));\n" " return;\n" " }\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid "" #| " for (i = 0; i E nreqs; i++) {\n" #| " if (wait_reqs[i] == NULL)\n" #| " continue;\n" msgid "" " for (size_t i = 0; i E nreqs; i++) {\n" " if (wait_reqs[i] == NULL)\n" " continue;\n" msgstr "" " for (i = 0; i E nreqs; i++) {\n" " if (wait_reqs[i] == NULL)\n" " continue;\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " ret = gai_error(reqs[i]);\n" " if (ret == EAI_INPROGRESS)\n" " continue;\n" msgstr "" " ret = gai_error(reqs[i]);\n" " if (ret == EAI_INPROGRESS)\n" " continue;\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid "" #| " printf(\"[%02d] %s: %s\\en\", i, reqs[i]-Ear_name,\n" #| " ret == 0 ? \"Finished\" : gai_strerror(ret));\n" #| " }\n" #| "}\n" msgid "" " printf(\"[%02zu] %s: %s\\en\", i, reqs[i]-Ear_name,\n" " ret == 0 ? \"Finished\" : gai_strerror(ret));\n" " }\n" "}\n" msgstr "" " printf(\"[%02d] %s: %s\\en\", i, reqs[i]-Ear_name,\n" " ret == 0 ? \"Выполнено\" : gai_strerror(ret));\n" " }\n" "}\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid "" #| "/* Cancel specified requests */\n" #| "static void\n" #| "cancel_requests(void)\n" #| "{\n" #| " char *id;\n" #| " int ret, n;\n" msgid "" "/* Cancel specified requests. */\n" "static void\n" "cancel_requests(void)\n" "{\n" " char *id;\n" " int ret;\n" " size_t n;\n" msgstr "" "/* отменяет заданные запросы */\n" "static void\n" "cancel_requests(void)\n" "{\n" " char *id;\n" " int ret, n;\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " ret = gai_cancel(reqs[n]);\n" " printf(\"[%s] %s: %s\\en\", id, reqs[atoi(id)]-Ear_name,\n" " gai_strerror(ret));\n" " }\n" "}\n" msgstr "" " ret = gai_cancel(reqs[n]);\n" " printf(\"[%s] %s: %s\\en\", id, reqs[atoi(id)]-Ear_name,\n" " gai_strerror(ret));\n" " }\n" "}\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid "" #| "/* List all requests */\n" #| "static void\n" #| "list_requests(void)\n" #| "{\n" #| " int i, ret;\n" #| " char host[NI_MAXHOST];\n" #| " struct addrinfo *res;\n" msgid "" "/* List all requests. */\n" "static void\n" "list_requests(void)\n" "{\n" " int ret;\n" " char host[NI_MAXHOST];\n" " struct addrinfo *res;\n" msgstr "" "/* перечислим все запросы */\n" "static void\n" "list_requests(void)\n" "{\n" " int i, ret;\n" " char host[NI_MAXHOST];\n" " struct addrinfo *res;\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid "" #| " for (i = 0; i E nreqs; i++) {\n" #| " printf(\"[%02d] %s: \", i, reqs[i]-Ear_name);\n" #| " ret = gai_error(reqs[i]);\n" msgid "" " for (size_t i = 0; i E nreqs; i++) {\n" " printf(\"[%02zu] %s: \", i, reqs[i]-Ear_name);\n" " ret = gai_error(reqs[i]);\n" msgstr "" " for (i = 0; i E nreqs; i++) {\n" " printf(\"[%02d] %s: \", i, reqs[i]-Ear_name);\n" " ret = gai_error(reqs[i]);\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " if (!ret) {\n" " res = reqs[i]-Ear_result;\n" msgstr "" " if (!ret) {\n" " res = reqs[i]-Ear_result;\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " ret = getnameinfo(res-Eai_addr, res-Eai_addrlen,\n" " host, sizeof(host),\n" " NULL, 0, NI_NUMERICHOST);\n" " if (ret) {\n" " fprintf(stderr, \"getnameinfo() failed: %s\\en\",\n" " gai_strerror(ret));\n" " exit(EXIT_FAILURE);\n" " }\n" " puts(host);\n" " } else {\n" " puts(gai_strerror(ret));\n" " }\n" " }\n" "}\n" msgstr "" " ret = getnameinfo(res-Eai_addr, res-Eai_addrlen,\n" " host, sizeof(host),\n" " NULL, 0, NI_NUMERICHOST);\n" " if (ret) {\n" " fprintf(stderr, \"ошибка getnameinfo(): %s\\en\",\n" " gai_strerror(ret));\n" " exit(EXIT_FAILURE);\n" " }\n" " puts(host);\n" " } else {\n" " puts(gai_strerror(ret));\n" " }\n" " }\n" "}\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid "" #| "int\n" #| "main(int argc, char *argv[])\n" #| "{\n" #| " char *cmdline;\n" #| " char *cmd;\n" msgid "" "int\n" "main(void)\n" "{\n" " char *cmdline;\n" " char *cmd;\n" msgstr "" "int\n" "main(int argc, char *argv[])\n" "{\n" " char *cmdline;\n" " char *cmd;\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " while ((cmdline = getcmd()) != NULL) {\n" " cmd = strtok(cmdline, \" \");\n" msgstr "" " while ((cmdline = getcmd()) != NULL) {\n" " cmd = strtok(cmdline, \" \");\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid "" #| " if (cmd == NULL) {\n" #| " list_requests();\n" #| " } else {\n" #| " switch (cmd[0]) {\n" #| " case \\(aqa\\(aq:\n" #| " add_requests();\n" #| " break;\n" #| " case \\(aqw\\(aq:\n" #| " wait_requests();\n" #| " break;\n" #| " case \\(aqc\\(aq:\n" #| " cancel_requests();\n" #| " break;\n" #| " case \\(aql\\(aq:\n" #| " list_requests();\n" #| " break;\n" #| " default:\n" #| " fprintf(stderr, \"Bad command: %c\\en\", cmd[0]);\n" #| " break;\n" #| " }\n" #| " }\n" #| " }\n" #| " exit(EXIT_SUCCESS);\n" #| "}\n" msgid "" " if (cmd == NULL) {\n" " list_requests();\n" " } else {\n" " switch (cmd[0]) {\n" " case \\[aq]a\\[aq]:\n" " add_requests();\n" " break;\n" " case \\[aq]w\\[aq]:\n" " wait_requests();\n" " break;\n" " case \\[aq]c\\[aq]:\n" " cancel_requests();\n" " break;\n" " case \\[aq]l\\[aq]:\n" " list_requests();\n" " break;\n" " default:\n" " fprintf(stderr, \"Bad command: %c\\en\", cmd[0]);\n" " break;\n" " }\n" " }\n" " }\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" " if (cmd == NULL) {\n" " list_requests();\n" " } else {\n" " switch (cmd[0]) {\n" " case \\(aqa\\(aq:\n" " add_requests();\n" " break;\n" " case \\(aqw\\(aq:\n" " wait_requests();\n" " break;\n" " case \\(aqc\\(aq:\n" " cancel_requests();\n" " break;\n" " case \\(aql\\(aq:\n" " list_requests();\n" " break;\n" " default:\n" " fprintf(stderr, \"Неверная команда: %c\\en\", cmd[0]);\n" " break;\n" " }\n" " }\n" " }\n" " exit(EXIT_SUCCESS);\n" "}\n" #. type: Plain text #: debian-bookworm debian-unstable opensuse-leap-15-6 opensuse-tumbleweed msgid "" "B(3), B(3), B(3), B(7), B(7), " "B(7)" msgstr "" "B(3), B(3), B(3), B(7), B(7), " "B(7)" #. type: TH #: debian-unstable opensuse-tumbleweed #, no-wrap msgid "2023-07-20" msgstr "20 июля 2023 г." #. type: TH #: debian-unstable opensuse-tumbleweed #, no-wrap msgid "Linux man-pages 6.05.01" msgstr "Linux man-pages 6.05.01" #. type: Plain text #: debian-unstable opensuse-tumbleweed #, no-wrap msgid "" "#define _GNU_SOURCE\n" "#include Enetdb.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Estring.hE\n" "\\&\n" "int\n" "main(int argc, char *argv[])\n" "{\n" " int ret;\n" " struct gaicb *reqs[argc - 1];\n" " char host[NI_MAXHOST];\n" " struct addrinfo *res;\n" "\\&\n" " if (argc E 2) {\n" " fprintf(stderr, \"Usage: %s HOST...\\en\", argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " for (size_t i = 0; i E argc - 1; i++) {\n" " reqs[i] = malloc(sizeof(*reqs[0]));\n" " if (reqs[i] == NULL) {\n" " perror(\"malloc\");\n" " exit(EXIT_FAILURE);\n" " }\n" " memset(reqs[i], 0, sizeof(*reqs[0]));\n" " reqs[i]-Ear_name = argv[i + 1];\n" " }\n" "\\&\n" " ret = getaddrinfo_a(GAI_WAIT, reqs, argc - 1, NULL);\n" " if (ret != 0) {\n" " fprintf(stderr, \"getaddrinfo_a() failed: %s\\en\",\n" " gai_strerror(ret));\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " for (size_t i = 0; i E argc - 1; i++) {\n" " printf(\"%s: \", reqs[i]-Ear_name);\n" " ret = gai_error(reqs[i]);\n" " if (ret == 0) {\n" " res = reqs[i]-Ear_result;\n" "\\&\n" " ret = getnameinfo(res-Eai_addr, res-Eai_addrlen,\n" " host, sizeof(host),\n" " NULL, 0, NI_NUMERICHOST);\n" " if (ret != 0) {\n" " fprintf(stderr, \"getnameinfo() failed: %s\\en\",\n" " gai_strerror(ret));\n" " exit(EXIT_FAILURE);\n" " }\n" " puts(host);\n" "\\&\n" " } else {\n" " puts(gai_strerror(ret));\n" " }\n" " }\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" #. type: Plain text #: debian-unstable opensuse-tumbleweed #, no-wrap msgid "" "#define _GNU_SOURCE\n" "#include Enetdb.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Estring.hE\n" "\\&\n" "static struct gaicb **reqs = NULL;\n" "static size_t nreqs = 0;\n" "\\&\n" "static char *\n" "getcmd(void)\n" "{\n" " static char buf[256];\n" "\\&\n" " fputs(\"E \", stdout); fflush(stdout);\n" " if (fgets(buf, sizeof(buf), stdin) == NULL)\n" " return NULL;\n" "\\&\n" " if (buf[strlen(buf) - 1] == \\[aq]\\en\\[aq])\n" " buf[strlen(buf) - 1] = 0;\n" "\\&\n" " return buf;\n" "}\n" "\\&\n" "/* Add requests for specified hostnames. */\n" "static void\n" "add_requests(void)\n" "{\n" " size_t nreqs_base = nreqs;\n" " char *host;\n" " int ret;\n" "\\&\n" " while ((host = strtok(NULL, \" \"))) {\n" " nreqs++;\n" " reqs = realloc(reqs, sizeof(reqs[0]) * nreqs);\n" "\\&\n" " reqs[nreqs - 1] = calloc(1, sizeof(*reqs[0]));\n" " reqs[nreqs - 1]-Ear_name = strdup(host);\n" " }\n" "\\&\n" " /* Queue nreqs_base..nreqs requests. */\n" "\\&\n" " ret = getaddrinfo_a(GAI_NOWAIT, &reqs[nreqs_base],\n" " nreqs - nreqs_base, NULL);\n" " if (ret) {\n" " fprintf(stderr, \"getaddrinfo_a() failed: %s\\en\",\n" " gai_strerror(ret));\n" " exit(EXIT_FAILURE);\n" " }\n" "}\n" "\\&\n" "/* Wait until at least one of specified requests completes. */\n" "static void\n" "wait_requests(void)\n" "{\n" " char *id;\n" " int ret;\n" " size_t n;\n" " struct gaicb const **wait_reqs = calloc(nreqs, sizeof(*wait_reqs));\n" " /* NULL elements are ignored by gai_suspend(). */\n" "\\&\n" " while ((id = strtok(NULL, \" \")) != NULL) {\n" " n = atoi(id);\n" "\\&\n" " if (n E= nreqs) {\n" " printf(\"Bad request number: %s\\en\", id);\n" " return;\n" " }\n" "\\&\n" " wait_reqs[n] = reqs[n];\n" " }\n" "\\&\n" " ret = gai_suspend(wait_reqs, nreqs, NULL);\n" " if (ret) {\n" " printf(\"gai_suspend(): %s\\en\", gai_strerror(ret));\n" " return;\n" " }\n" "\\&\n" " for (size_t i = 0; i E nreqs; i++) {\n" " if (wait_reqs[i] == NULL)\n" " continue;\n" "\\&\n" " ret = gai_error(reqs[i]);\n" " if (ret == EAI_INPROGRESS)\n" " continue;\n" "\\&\n" " printf(\"[%02zu] %s: %s\\en\", i, reqs[i]-Ear_name,\n" " ret == 0 ? \"Finished\" : gai_strerror(ret));\n" " }\n" "}\n" "\\&\n" "/* Cancel specified requests. */\n" "static void\n" "cancel_requests(void)\n" "{\n" " char *id;\n" " int ret;\n" " size_t n;\n" "\\&\n" " while ((id = strtok(NULL, \" \")) != NULL) {\n" " n = atoi(id);\n" "\\&\n" " if (n E= nreqs) {\n" " printf(\"Bad request number: %s\\en\", id);\n" " return;\n" " }\n" "\\&\n" " ret = gai_cancel(reqs[n]);\n" " printf(\"[%s] %s: %s\\en\", id, reqs[atoi(id)]-Ear_name,\n" " gai_strerror(ret));\n" " }\n" "}\n" "\\&\n" "/* List all requests. */\n" "static void\n" "list_requests(void)\n" "{\n" " int ret;\n" " char host[NI_MAXHOST];\n" " struct addrinfo *res;\n" "\\&\n" " for (size_t i = 0; i E nreqs; i++) {\n" " printf(\"[%02zu] %s: \", i, reqs[i]-Ear_name);\n" " ret = gai_error(reqs[i]);\n" "\\&\n" " if (!ret) {\n" " res = reqs[i]-Ear_result;\n" "\\&\n" " ret = getnameinfo(res-Eai_addr, res-Eai_addrlen,\n" " host, sizeof(host),\n" " NULL, 0, NI_NUMERICHOST);\n" " if (ret) {\n" " fprintf(stderr, \"getnameinfo() failed: %s\\en\",\n" " gai_strerror(ret));\n" " exit(EXIT_FAILURE);\n" " }\n" " puts(host);\n" " } else {\n" " puts(gai_strerror(ret));\n" " }\n" " }\n" "}\n" "\\&\n" "int\n" "main(void)\n" "{\n" " char *cmdline;\n" " char *cmd;\n" "\\&\n" " while ((cmdline = getcmd()) != NULL) {\n" " cmd = strtok(cmdline, \" \");\n" "\\&\n" " if (cmd == NULL) {\n" " list_requests();\n" " } else {\n" " switch (cmd[0]) {\n" " case \\[aq]a\\[aq]:\n" " add_requests();\n" " break;\n" " case \\[aq]w\\[aq]:\n" " wait_requests();\n" " break;\n" " case \\[aq]c\\[aq]:\n" " cancel_requests();\n" " break;\n" " case \\[aq]l\\[aq]:\n" " list_requests();\n" " break;\n" " default:\n" " fprintf(stderr, \"Bad command: %c\\en\", cmd[0]);\n" " break;\n" " }\n" " }\n" " }\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" #. type: TH #: opensuse-leap-15-6 #, no-wrap msgid "2023-03-30" msgstr "30 марта 2023 г." #. type: TH #: opensuse-leap-15-6 #, no-wrap msgid "Linux man-pages 6.04" msgstr "Linux man-pages 6.04"