# Russian translation of manpages # This file is distributed under the same license as the manpages-l10n package. # Copyright © of this file: # Azamat Hackimov , 2013, 2016. # Dmitriy Ovchinnikov , 2012. # Dmitry Bolkhovskikh , 2017. # Katrin Kutepova , 2018. # Yuri Kozlov , 2011-2019. # Иван Павлов , 2017. msgid "" msgstr "" "Project-Id-Version: manpages-l10n\n" "POT-Creation-Date: 2024-06-01 06:33+0200\n" "PO-Revision-Date: 2019-10-15 18:59+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 "UNIX" msgstr "UNIX" #. type: TH #: archlinux debian-unstable opensuse-tumbleweed #, no-wrap msgid "2024-05-02" msgstr "2 мая 2024 г." #. type: TH #: archlinux debian-unstable #, fuzzy, no-wrap #| msgid "Linux man-pages 6.7" msgid "Linux man-pages 6.8" msgstr "Linux man-pages 6.7" #. 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 "unix - sockets for local interprocess communication" msgstr "unix - сокеты для локального межпроцессного взаимодействия" #. 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 #, fuzzy, no-wrap #| msgid "" #| "B<#include Esys/types.hE>\n" #| "B<#include Esys/xattr.hE>\n" msgid "" "B<#include Esys/socket.hE>\n" "B<#include Esys/un.hE>\n" msgstr "" "B<#include Esys/types.hE>\n" "B<#include Esys/xattr.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 "IB< = socketpair(AF_UNIX, type, 0, int *>IB<);>" msgid "" "IB< = socket(AF_UNIX, type, 0);>\n" "IB< = socketpair(AF_UNIX, type, 0, int *>IB<);>\n" msgstr "IB< = socketpair(AF_UNIX, type, 0, int *>IB<);>" #. 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 (also known as B) socket family is used to " "communicate between processes on the same machine efficiently. " "Traditionally, UNIX domain sockets can be either unnamed, or bound to a " "filesystem pathname (marked as being of type socket). Linux also supports " "an abstract namespace which is independent of the filesystem." msgstr "" "Семейство сокетов B (также известное, как B) используется " "для эффективного взаимодействия между процессами на одной машине. Доменные " "сокеты UNIX могут быть как безымянными, так и иметь имя файла в файловой " "системе (типизированный сокет). В Linux также поддерживается абстрактное " "пространство имён, которое не зависит от файловой системы." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Valid socket types in the UNIX domain are: B, for a stream-" "oriented socket; B, for a datagram-oriented socket that " "preserves message boundaries (as on most UNIX implementations, UNIX domain " "datagram sockets are always reliable and don't reorder datagrams); and " "(since Linux 2.6.4) B, for a sequenced-packet socket that " "is connection-oriented, preserves message boundaries, and delivers messages " "in the order that they were sent." msgstr "" "Допустимые типы сокета для домена UNIX: потоковый сокет B, " "датаграмный сокет B, сохраняющий границы сообщений (в " "большинстве реализаций UNIX, доменные датаграмные сокеты UNIX всегда надёжны " "и не меняют порядок датаграмм); и (начиная с Linux 2.6.4) ориентированный " "на соединение задающий последовательность пакетам сокет B, " "сохраняющий границы сообщений и доставляющий сообщения в том же порядке, в " "каком они были отправлены." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "UNIX domain sockets support passing file descriptors or process credentials " "to other processes using ancillary data." msgstr "" "Доменные сокеты UNIX поддерживают передачу файловых дескрипторов или учётных " "данных (credentials) о процессе другим процессам, используя вспомогательные " "(ancillary) данные." #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Address format" msgstr "Формат адреса" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "A UNIX domain socket address is represented in the following structure:" msgstr "Адрес доменного сокета UNIX представляет собой следующую структуру:" #. #define UNIX_PATH_MAX 108 #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "" "struct sockaddr_un {\n" " sa_family_t sun_family; /* AF_UNIX */\n" " char sun_path[108]; /* Pathname */\n" "};\n" msgstr "" "struct sockaddr_un {\n" " sa_family_t sun_family; /* AF_UNIX */\n" " char sun_path[108]; /* имя пути */\n" "};\n" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, fuzzy #| msgid "" #| "The I field always contains B. On Linux, " #| "I is 108 bytes in size; see also NOTES, below." msgid "" "The I field always contains B. On Linux, I " "is 108 bytes in size; see also BUGS, below." msgstr "" "Поле I всегда содержит B. В Linux размер I " "равен 108 байтам; также смотрите ЗАМЕЧАНИЯ ниже." #. type: Plain text #: archlinux debian-unstable fedora-rawhide opensuse-tumbleweed #, fuzzy #| msgid "" #| "Various systems calls (for example, B(2), B(2), and " #| "B(2)) take a I argument as input. Some other " #| "system calls (for example, B(2), B(2), " #| "B(2), and B(2)) return an argument of this type." msgid "" "Various system calls (for example, B(2), B(2), and " "B(2)) take a I argument as input. Some other system " "calls (for example, B(2), B(2), B(2), " "and B(2)) return an argument of this type." msgstr "" "В различных системных вызовах (например, B(2), B(2) и " "B(2)) в качестве входных данных используется параметр " "I. Другие системные вызовы (например, B(2), " "B(2), B(2) и B(2)) возвращают результат в " "параметре этого типа." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Three types of address are distinguished in the I structure:" msgstr "В I структуре различают три типа адресов:" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "pathname" msgstr "pathname (путь)" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, fuzzy #| msgid "" #| "I: a UNIX domain socket can be bound to a null-terminated " #| "filesystem pathname using B(2). When the address of a pathname " #| "socket is returned (by one of the system calls noted above), its length is" msgid "" "a UNIX domain socket can be bound to a null-terminated filesystem pathname " "using B(2). When the address of a pathname socket is returned (by one " "of the system calls noted above), its length is" msgstr "" "I<с именем пути>: доменный сокет UNIX может быть привязан к имени пути (с " "завершающимся null) в файловой системе с помощью B(2). При возврате " "адреса имени пути сокета (одним и системных вызовов, упомянутых выше), его " "длина равна" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid " offsetof(struct sockaddr_un, sun_path) + strlen(sun_path) + 1\n" msgid "offsetof(struct sockaddr_un, sun_path) + strlen(sun_path) + 1\n" msgstr " offsetof(struct sockaddr_un, sun_path) + strlen(sun_path) + 1\n" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "and I contains the null-terminated pathname. (On Linux, the above " "B() expression equates to the same value as " "I, but some other implementations include other fields " "before I, so the B() expression more portably describes " "the size of the address structure.)" msgstr "" "и I содержит путь, оканчивающийся null (в Linux, указанное выше " "выражение B() равно I, но в некоторых " "реализациях включаются другие поля перед I, поэтому выражение " "B() описывает размер адресной структуры более переносимым " "способом)." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "For further details of pathname sockets, see below." msgstr "Дополнительную информацию о путях сокета смотрите далее." #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "username" msgid "unnamed" msgstr "username (имя пользователя)" #. There is quite some variation across implementations: FreeBSD #. says the length is 16 bytes, HP-UX 11 says it's zero bytes. #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, fuzzy #| msgid "" #| "I: A stream socket that has not been bound to a pathname using " #| "B(2) has no name. Likewise, the two sockets created by " #| "B(2) are unnamed. When the address of an unnamed socket is " #| "returned, its length is I, and I should " #| "not be inspected." msgid "" "A stream socket that has not been bound to a pathname using B(2) has " "no name. Likewise, the two sockets created by B(2) are " "unnamed. When the address of an unnamed socket is returned, its length is " "I, and I should not be inspected." msgstr "" "I<безымянный>: Потоковый сокет, который не привязан к имени пути с помощью " "B(), не имеет имени. Аналогично, два сокета, создаваемые " "B(), также не имеют имён. При возврате адреса сокета его длина " "равна I, а значение I не используется." #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "abstract" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, fuzzy #| msgid "" #| "I: an abstract socket address is distinguished (from a pathname " #| "socket) by the fact that I is a null byte (\\(aq" #| "\\e0\\(aq). The socket's address in this namespace is given by the " #| "additional bytes in I that are covered by the specified length " #| "of the address structure. (Null bytes in the name have no special " #| "significance.) The name has no connection with filesystem pathnames. " #| "When the address of an abstract socket is returned, the returned " #| "I is greater than I (i.e., greater than 2), " #| "and the name of the socket is contained in the first I<(addrlen - " #| "sizeof(sa_family_t))> bytes of I." msgid "" "an abstract socket address is distinguished (from a pathname socket) by the " "fact that I is a null byte (\\[aq]\\e0\\[aq]). The socket's " "address in this namespace is given by the additional bytes in I " "that are covered by the specified length of the address structure. (Null " "bytes in the name have no special significance.) The name has no connection " "with filesystem pathnames. When the address of an abstract socket is " "returned, the returned I is greater than I (i." "e., greater than 2), and the name of the socket is contained in the first " "I<(addrlen - sizeof(sa_family_t))> bytes of I." msgstr "" "I<абстрактный>: абстрактный адрес сокета отличается (от имени пути сокета) " "тем, что значением I является байт null (\\(aq\\e0\\(aq). Адрес " "сокета в этом пространстве имён определяется дополнительными байтами в " "I, количество которых определяется длиной указанной структуры " "адреса. Байты null в имени не имеют специального значения. Имя не связано с " "именем пути в файловой системе. При возврате адреса абстрактного сокета " "возвращаемое значение I больше чем I (т.е. " "больше 2), а имя сокета содержится в первых I<(addrlen - " "sizeof(sa_family_t))> байтах I." #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Pathname sockets" msgstr "Путевые сокеты" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "When binding a socket to a pathname, a few rules should be observed for " "maximum portability and ease of coding:" msgstr "" "При привязке сокета к пути для максимальной переносимости и простоте " "кодирования нужно учесть несколько правил:" #. 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 "The pathname in I should be null-terminated." msgstr "Имя пути в I должно завершаться null." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The length of the pathname, including the terminating null byte, should not " "exceed the size of I." msgstr "" "Длина имени пути, включая завершающий байт null, не должна превышать размер " "I." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The I argument that describes the enclosing I " "structure should have a value of at least:" msgstr "" "Аргумент I, описывающий включаемую структуру I, должен " "содержать значение, как минимум:" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid " offsetof(struct sockaddr_un, sun_path)+strlen(addr.sun_path)+1\n" msgid "offsetof(struct sockaddr_un, sun_path)+strlen(addr.sun_path)+1\n" msgstr " offsetof(struct sockaddr_un, sun_path)+strlen(addr.sun_path)+1\n" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "or, more simply, I can be specified as I." msgstr "" "или, проще говоря, для I можно использовать I." #. Linux does this, including for the case where the supplied path #. is 108 bytes #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "There is some variation in how implementations handle UNIX domain socket " "addresses that do not follow the above rules. For example, some (but not " "all) implementations append a null terminator if none is present in the " "supplied I." msgstr "" "Есть несколько реализаций по работе с адресами доменных сокетов UNIX, " "которые не следуют данным правилам. Например, в некоторых реализациях (но не " "во всех) добавляется конечный null, если если его нет в I." #. HP-UX #. Modern BSDs generally have 104, Tru64 and AIX have 104, #. Solaris and Irix have 108 #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "When coding portable applications, keep in mind that some implementations " "have I as short as 92 bytes." msgstr "" "При написании переносимых приложений учтите, что в некоторых реализациях " "размер Iравен 92 байтам." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Various system calls (B(2), B(2), B(2), " "B(2)) return socket address structures. When applied to UNIX " "domain sockets, the value-result I argument supplied to the call " "should be initialized as above. Upon return, the argument is set to " "indicate the I size of the address structure. The caller should " "check the value returned in this argument: if the output value exceeds the " "input value, then there is no guarantee that a null terminator is present in " "I. (See BUGS.)" msgstr "" "Различные системные вызовы (например, B(2), B(2), " "B(2), B(2)) возвращают адресные структуры сокета. " "В случае с доменными сокетами UNIX аргумент значение-результат I, " "передаваемый вызову, должен быть инициализирован как описано выше. При " "возврате в аргументе содержится I<реальный> размер адресной структуры. " "Вызывающий должен проверить полученное значение этого аргумента: если оно " "превышает значение до вызова, то не гарантируется наличие конечного null в " "I (смотрите ДЕФЕКТЫ)." #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Pathname socket ownership and permissions" msgstr "Пути к сокетам и права" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "In the Linux implementation, pathname sockets honor the permissions of the " "directory they are in. Creation of a new socket fails if the process does " "not have write and search (execute) permission on the directory in which the " "socket is created." msgstr "" "В реализации Linux учитываются права на каталоги, в которых располагаются " "сокеты. Создание нового сокета завершается ошибкой, если процесс не имеет " "права писать или искать (выполнять) в каталог, в котором создаётся сокет." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "On Linux, connecting to a stream socket object requires write permission on " "that socket; sending a datagram to a datagram socket likewise requires write " "permission on that socket. POSIX does not make any statement about the " "effect of the permissions on a socket file, and on some systems (e.g., older " "BSDs), the socket permissions are ignored. Portable programs should not " "rely on this feature for security." msgstr "" "В Linux для подключения к объекту потокового сокета требуются права на " "запись в этот сокет; схожим образом, для отправки дейтаграммы в " "дейтаграммный сокет требуются права на запись в этот сокет. В POSIX ничего " "не сказано о влиянии прав файла сокета и в некоторых системах (например, в " "старых BSD) права на сокет игнорируются. Переносимые программы не должны " "полагаться на это свойство для обеспечения безопасности." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "When creating a new socket, the owner and group of the socket file are set " "according to the usual rules. The socket file has all permissions enabled, " "other than those that are turned off by the process B(2)." msgstr "" "При создании нового сокета владелец и группа файла сокета назначаются " "согласно обычных правил. К файлу сокета разрешается любой доступ кроме " "выключенного процессом с помощью B(2)." #. However, fchown() and fchmod() do not seem to have an effect #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The owner, group, and permissions of a pathname socket can be changed (using " "B(2) and B(2))." msgstr "" "Владелец, группа и права доступа пути сокета можно изменять (с помощью " "B(2) и B(2))." #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Abstract sockets" msgstr "Абстрактные сокеты" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Socket permissions have no meaning for abstract sockets: the process " "B(2) has no effect when binding an abstract socket, and changing the " "ownership and permissions of the object (via B(2) and " "B(2)) has no effect on the accessibility of the socket." msgstr "" "Права на сокеты не учитываются у абстрактных сокетов: B(2) процесса " "не учитывается при подключении к абстрактному сокету как и изменение " "владельца и прав доступа к объекту (посредством B(2) и B(2)) " "не влияют на доступность сокета." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Abstract sockets automatically disappear when all open references to the " "socket are closed." msgstr "" "Абстрактные сокеты автоматически исчезают при закрытии всех открытых ссылок " "на них." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "The abstract socket namespace is a nonportable Linux extension." msgstr "" "Пространство имён абстрактных сокетов является непереносимым расширением " "Linux." #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Socket options" msgstr "Параметры сокета" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "For historical reasons, these socket options are specified with a " "B type even though they are B specific. They can be " "set with B(2) and read with B(2) by specifying " "B as the socket family." msgstr "" "В силу исторических причин эти параметры сокетов относятся к типу " "B, даже если они относятся к B. Они могут быть " "установлены с помощью B(2) и прочитаны с помощью " "B(2); тип 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 "" "Enabling this socket option causes receipt of the credentials of the sending " "process in an B message in each subsequently " "received message. The returned credentials are those specified by the " "sender using B, or a default that includes the sender's " "PID, real user ID, and real group ID, if the sender did not specify " "B ancillary data." msgstr "" "Разрешает приём учётных данных посылающего процесса в вспомогательном " "сообщении B каждого последующего принятого сообщения. " "Полученные учётные данные были заданы отправителем с помощью " "B, или имеют значение по умолчанию, которое содержит PID " "отправителя, фактический пользовательский и групповой ID, если отправитель " "не задал вспомогательные данные B." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "When this option is set and the socket is not yet connected, a unique name " "in the abstract namespace will be generated automatically." msgstr "" "Если при включении этого параметра сокет ещё не соединён, то в абстрактном " "пространстве имён будет автоматически создано уникальное имя." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The value given as an argument to B(2) and returned as the " "result of B(2) is an integer boolean flag." msgstr "" "Значение передаётся в аргументе B(2) и возвращается в результате " "B(2) в виде целочисленного логического флага." #. 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 "" "Enables receiving of the SELinux security label of the peer socket in an " "ancillary message of type B (see below)." msgstr "" "Разрешает приём метки безопасности SELinux однорангового сокета в " "вспомогательном сообщении с типом B (смотрите ниже)." #. commit 877ce7c1b3afd69a9b1caeb1b9964c992641f52a #. commit 37a9a8df8ce9de6ea73349c9ac8bdf6ba4ec4f70 #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The B option is supported for UNIX domain datagram sockets since " "Linux 2.6.18; support for UNIX domain stream sockets was added in Linux 4.2." msgstr "" "Параметр B поддерживается для дейтаграммных доменных сокетов " "UNIX начиная с Linux 2.6.18; поддержка потоковых доменных сокетов UNIX " "добавлена в Linux 4.2." #. 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 "See B(7)." msgstr "Смотрите B(7)." #. 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-unstable fedora-40 fedora-rawhide mageia-cauldron #: opensuse-tumbleweed #, fuzzy #| msgid "" #| "This read-only socket option returns the credentials of the peer process " #| "connected to this socket. The returned credentials are those that were " #| "in effect at the time of the call to B(2) or B(2)." msgid "" "This read-only socket option returns the credentials of the peer process " "connected to this socket. The returned credentials are those that were in " "effect at the time of the call to B(2), B(2), or " "B(2)." msgstr "" "С параметром сокета, доступным только для чтения, возвращаются учётные " "данные однорангового процесса, соединённого с сокетом. Возвращаются " "информационные данные, которые были действительными на момент вызова " "B(2) или B(2)." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The argument to B(2) is a pointer to a I structure; " "define the B<_GNU_SOURCE> feature test macro to obtain the definition of " "that structure from Isys/socket.hE>." msgstr "" "Аргументом B(2) является указатель на структуру I; " "определите макрос тестирования свойств B<_GNU_SOURCE> для получения " "определения этой структуры из Isys/socket.hE>." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The use of this option is possible only for connected B stream " "sockets and for B stream and datagram socket pairs created using " "B(2)." msgstr "" "Использование этого параметра возможо только для соединённых потоковых " "сокетов B и потоков B и для дейтаграммных сокетных пар, " "созданных с помощью B(2)." #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "B" 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 "" "This read-only socket option returns the security context of the peer socket " "connected to this socket. By default, this will be the same as the security " "context of the process that created the peer socket unless overridden by the " "policy or by a process with the required permissions." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The argument to B(2) is a pointer to a buffer of the specified " "length in bytes into which the security context string will be copied. If " "the buffer length is less than the length of the security context string, " "then B(2) returns -1, sets I to B, and returns " "the required length via I. The caller should allocate at least " "B bytes for the buffer initially, although this is not guaranteed " "to be sufficient. Resizing the buffer to the returned length and retrying " "may be necessary." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The security context string may include a terminating null character in the " "returned length, but is not guaranteed to do so: a security context \"foo\" " "might be represented as either {'f','o','o'} of length 3 or " "{'f','o','o','\\e0'} of length 4, which are considered to be " "interchangeable. The string is printable, does not contain non-terminating " "null characters, and is in an unspecified encoding (in particular, it is not " "guaranteed to be ASCII or UTF-8)." msgstr "" #. commit 0b811db2cb2aabc910e53d34ebb95a15997c33e7 #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, fuzzy #| msgid "" #| "The use of this option is possible only for connected B stream " #| "sockets and for B stream and datagram socket pairs created using " #| "B(2)." msgid "" "The use of this option for sockets in the B address family is " "supported since Linux 2.6.2 for connected stream sockets, and since Linux " "4.18 also for stream and datagram socket pairs created using " "B(2)." msgstr "" "Использование этого параметра возможо только для соединённых потоковых " "сокетов B и потоков B и для дейтаграммных сокетных пар, " "созданных с помощью B(2)." #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Autobind feature" msgstr "Свойство автоматической привязки" #. i.e., sizeof(short) #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, fuzzy #| msgid "" #| "If a B(2) call specifies I as I, or " #| "the B socket option was specified for a socket that was not " #| "explicitly bound to an address, then the socket is autobound to an " #| "abstract address. The address consists of a null byte followed by 5 " #| "bytes in the character set I<[0-9a-f]>. Thus, there is a limit of 2^20 " #| "autobind addresses. (From Linux 2.1.15, when the autobind feature was " #| "added, 8 bytes were used, and the limit was thus 2^32 autobind " #| "addresses. The change to 5 bytes came in Linux 2.3.15.)" msgid "" "If a B(2) call specifies I as I, or the " "B socket option was specified for a socket that was not " "explicitly bound to an address, then the socket is autobound to an abstract " "address. The address consists of a null byte followed by 5 bytes in the " "character set I<[0-9a-f]>. Thus, there is a limit of 2\\[ha]20 autobind " "addresses. (From Linux 2.1.15, when the autobind feature was added, 8 bytes " "were used, and the limit was thus 2\\[ha]32 autobind addresses. The change " "to 5 bytes came in Linux 2.3.15.)" msgstr "" "Если в вызов B(2) передано значение I равное " "I, или для сокета, который не привязан к адресу явно, " "был указан параметр сокета B, то сокет автоматически " "привязывается к абстрактному адресу. Адрес состоит из байта null и 5 байтов " "символов из набора I<[0-9a-f]>. Таким образом, максимальное количество " "автоматически привязываемых адресов равно 2^20 (в Linux 2.1.15, когда была " "добавлена автоматическая привязка, использовалось 8 байт, и, таким образом, " "ограничение было 2^32 адресов. В Linux 2.3.15 количество байт сократили до " "5)." #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Sockets API" msgstr "Программный интерфейс сокетов" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The following paragraphs describe domain-specific details and unsupported " "features of the sockets API for UNIX domain sockets on Linux." msgstr "" "В следующих параграфах описываются специфичные тонкости доменов и " "неподдерживаемые возможности программного интерфейса сокетов для доменных " "сокетов UNIX в Linux." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "UNIX domain sockets do not support the transmission of out-of-band data (the " "B flag for B(2) and B(2))." msgstr "" "Доменные сокеты UNIX не поддерживают передачу внеполосных данных (флаг " "B у B(2) и B(2))." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The B(2) B flag is not supported by UNIX domain sockets." msgstr "" "Флаг B у B(2) не поддерживается доменными сокетами UNIX." #. commit 9f6f9af7694ede6314bed281eec74d588ba9474f #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Before Linux 3.4, the use of B in the I argument of " "B(2) was not supported by UNIX domain sockets." msgstr "" "До Linux 3.4 использование B в аргументе I у B(2) не " "поддерживалось доменными сокетами UNIX." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The B socket option does have an effect for UNIX domain sockets, " "but the B option does not. For datagram sockets, the " "B value imposes an upper limit on the size of outgoing " "datagrams. This limit is calculated as the doubled (see B(7)) " "option value less 32 bytes used for overhead." msgstr "" "Параметр сокета B учитывается в доменных сокетах UNIX, а параметр " "B \\(em нет. Для датаграмных сокетов значение B " "считается максимальным размером для исходящих датаграмм. Это ограничение, " "вычисляемое как удвоенное значение (см. B(7)) параметра, содержит " "меньше 32 байт накладных расходов." #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Ancillary messages" msgstr "Вспомогательные сообщения" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Ancillary data is sent and received using B(2) and B(2). " "For historical reasons, the ancillary message types listed below are " "specified with a B type even though they are B " "specific. To send them, set the I field of the struct " "I to B and the I field to the type. For " "more information, see B(3)." msgstr "" "Вспомогательные данные отправляются и принимаются с помощью B(2) и " "B(2). В силу исторических причин перечисленные типы вспомогательных " "сообщений относятся к типу B, даже если они относятся к " "B. Для того, чтобы отправить их, установите значение поля " "I структуры I равным B, а в значении поля " "I укажите его тип. Дополнительная информация приведена в " "B(3)." #. 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 "" "Send or receive a set of open file descriptors from another process. The " "data portion contains an integer array of the file descriptors." msgstr "" "Передать или принять набор открытых файловых дескрипторов из другого " "процесса. Часть с данными содержит целочисленный массив файловых " "дескрипторов." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Commonly, this operation is referred to as \"passing a file descriptor\" to " "another process. However, more accurately, what is being passed is a " "reference to an open file description (see B(2)), and in the receiving " "process it is likely that a different file descriptor number will be used. " "Semantically, this operation is equivalent to duplicating (B(2)) a " "file descriptor into the file descriptor table of another process." msgstr "" "Обычно, эта операция упоминается как «передача дескриптора файла» другому " "процессу. Но если точнее, то передается ссылка на открытое файловое описание " "(смотрите B(2)) и в принимающем процессе будет использоваться, " "вероятно, файловый дескриптор с другим номером. Семантически, эта операция " "эквивалентна дублированию (B(2)) файлового дескриптора в таблицу " "файловых дескрипторов другого процесса." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "If the buffer used to receive the ancillary data containing file descriptors " "is too small (or is absent), then the ancillary data is truncated (or " "discarded) and the excess file descriptors are automatically closed in the " "receiving process." msgstr "" "Если используемый для приёма вспомогательных данных с файловыми " "дескрипторами буфер слишком мал (или отсутствует), то вспомогательные данные " "обрезаются (или отбрасываются), а избыточные файловые дескрипторы " "автоматически закрываются в принимающем процессе." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "If the number of file descriptors received in the ancillary data would cause " "the process to exceed its B resource limit (see " "B(2)), the excess file descriptors are automatically closed in " "the receiving process." msgstr "" "Если количество файловых дескрипторов, полученных во вспомогательных данных, " "превышает ограничение ресурса процесса B (смотрите " "B(2)), то превысившие файловые дескрипторы автоматически " "закрываются в принимающем процессе." #. commit bba14de98753cb6599a2dae0e520714b2153522d #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, fuzzy #| msgid "" #| "The kernel constant B defines a limit on the number of file " #| "descriptors in the array. Attempting to send an array larger than this " #| "limit causes B(2) to fail with the error B. " #| "B has the value 253 (or 255 in kernels before 2.6.38)." msgid "" "The kernel constant B defines a limit on the number of file " "descriptors in the array. Attempting to send an array larger than this " "limit causes B(2) to fail with the error B. B " "has the value 253 (or 255 before Linux 2.6.38)." msgstr "" "Константой ядра B задаётся ограничение на количество файловых " "дескрипторов в массиве. Попытка послать с помощью B(2) массив " "превышающий ограничение завершается ошибкой B. Значение " "B равно 253 (или 255 в ядрах до версии 2.6.38)." #. 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 #, fuzzy #| msgid "" #| "Send or receive UNIX credentials. This can be used for authentication. " #| "The credentials are passed as a I ancillary message. Thus " #| "structure is defined in Isys/socket.hE> as follows:" msgid "" "Send or receive UNIX credentials. This can be used for authentication. The " "credentials are passed as a I ancillary message. This " "structure is defined in Isys/socket.hE> as follows:" msgstr "" "Передать или принять учётные данные UNIX. Может быть использована для " "аутентификации. Учётные данные передаются в виде структуры I " "вспомогательного сообщения. Эта структура определена в Isys/socket." "hE> следующим образом:" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "" "struct ucred {\n" " pid_t pid; /* Process ID of the sending process */\n" " uid_t uid; /* User ID of the sending process */\n" " gid_t gid; /* Group ID of the sending process */\n" "};\n" msgstr "" "struct ucred {\n" " pid_t pid; /* идентификатор посылающего процесса */\n" " uid_t uid; /* идентификатор пользователя посылающего процесса */\n" " gid_t gid; /* идентификатор группы посылающего процесса */\n" "};\n" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Since glibc 2.8, the B<_GNU_SOURCE> feature test macro must be defined " "(before including I header files) in order to obtain the definition of " "this structure." msgstr "" "Начиная с glibc 2.8, чтобы получить определение данной структуры должен быть " "определён макрос тестирования свойств B<_GNU_SOURCE> (до включения I<каких-" "либо> заголовочных файлов)." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, fuzzy #| msgid "" #| "The credentials which the sender specifies are checked by the kernel. A " #| "privileged process is allowed to specify values that do not match its " #| "own. The sender must specify its own process ID (unless it has the " #| "capability B), its real user ID, effective user ID, or " #| "saved set-user-ID (unless it has B), and its real group ID, " #| "effective group ID, or saved set-group-ID (unless it has B)." msgid "" "The credentials which the sender specifies are checked by the kernel. A " "privileged process is allowed to specify values that do not match its own. " "The sender must specify its own process ID (unless it has the capability " "B, in which case the PID of any existing process may be " "specified), its real user ID, effective user ID, or saved set-user-ID " "(unless it has B), and its real group ID, effective group ID, or " "saved set-group-ID (unless it has B)." msgstr "" "Учётные данные (credentials), указываемые отправителем, проверяются ядром. " "Привилегированный процесс может указывать значения, отличные от его " "собственных. Отправитель должен указать идентификатор своего процесса (если " "только он не имеет мандата B), свой реальный идентификатор " "пользователя, действующий идентификатор или сохранённый set-user-ID (если " "только он не имеет B) и реальный идентификатор своей группы, " "действующий идентификатор группы или сохранённый set-group-ID (если только " "он не имеет B)." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "To receive a I message, the B option must be " "enabled on the socket." msgstr "" "Для получения сообщения со структурой 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 debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Receive the SELinux security context (the security label) of the peer " "socket. The received ancillary data is a null-terminated string containing " "the security context. The receiver should allocate at least B " "bytes in the data portion of the ancillary message for this data." msgstr "" "Получить контекст безопасности SELinux (метку безопасности) однорангового " "сокета. Полученные вспомогательные данные представляют собой строку (с null " "в конце) с контекстом безопасности. Получатель должен выделить не менее " "B байт под эти данные в в части данных вспомогательного сообщения." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "To receive the security context, the B option must be enabled on " "the socket (see above)." msgstr "" "Для получения контекста безопасности у сокета должен быть включён параметр " "B (смотрите выше)." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "When sending ancillary data with B(2), only one item of each of the " "above types may be included in the sent message." msgstr "" "При отправке вспомогательных данных с помощью B(2) посылаемое " "сообщение может содержать только по одному элементу каждого типа, из " "представленных выше." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "At least one byte of real data should be sent when sending ancillary data. " "On Linux, this is required to successfully send ancillary data over a UNIX " "domain stream socket. When sending ancillary data over a UNIX domain " "datagram socket, it is not necessary on Linux to send any accompanying real " "data. However, portable applications should also include at least one byte " "of real data when sending ancillary data over a datagram socket." msgstr "" "По крайней мере один байт реальных данных должен быть отправлен при отправке " "вспомогательных данных. В Linux это требуется для успешной отправки " "вспомогательных данных через потоковый доменный сокет UNIX. При отправке " "вспомогательных данных через дейтаграммный доменный сокет UNIX в Linux " "необязательно отправлять какие-либо реальные сопровождающие данные. Однако " "переносимые приложения должны также включать, по крайней мере, один байт " "реальных данных при отправке вспомогательных данных через дейтаграммный " "сокет." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "When receiving from a stream socket, ancillary data forms a kind of barrier " "for the received data. For example, suppose that the sender transmits as " "follows:" msgstr "" "При получении из потокового сокета вспомогательные данные формируют своего " "рода барьер для полученных данных. Например, предположим, что отправитель " "передает так:" #. type: IP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "(1)" msgstr "(1)" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "B(2) of four bytes, with no ancillary data." msgstr "B(2) отправляет четыре байта без вспомогательных данных." #. type: IP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "(2)" msgstr "(2)" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "B(2) of one byte, with ancillary data." msgstr "B(2) отправляет один байт вспомогательных данных." #. type: IP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "(3)" msgstr "(3)" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, fuzzy #| msgid "" #| "Suppose that the receiver now performs B(2) calls each with a " #| "buffer size of 20 bytes. The first call will receive five bytes of data, " #| "along with the ancillary data sent by the second B(2) call. " #| "The next call will receive the remaining five bytes of data." msgid "" "Suppose that the receiver now performs B(2) calls each with a " "buffer size of 20 bytes. The first call will receive five bytes of data, " "along with the ancillary data sent by the second B(2) call. The " "next call will receive the remaining four bytes of data." msgstr "" "Предположим, что получатель теперь выполняет каждый вызов B(2) с " "буфером размером 20 байтов. Первый вызов получит пять байтов данных вместе с " "вспомогательными данными, отправленными вторым вызовом B(2). " "Следующий вызов получит оставшиеся пять байтов данных." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "If the space allocated for receiving incoming ancillary data is too small " "then the ancillary data is truncated to the number of headers that will fit " "in the supplied buffer (or, in the case of an B file descriptor " "list, the list of file descriptors may be truncated). If no buffer is " "provided for incoming ancillary data (i.e., the I field of the " "I structure supplied to B(2) is NULL), then the incoming " "ancillary data is discarded. In both of these cases, the B flag " "will be set in the I value returned by B(2)." msgstr "" "Если место, выделенное для получения входящих вспомогательных данных, " "слишком маленькое, то вспомогательные данные обрезаются по количеству " "заголовков, которые влезут в предоставленной буфер (или, в случае списка " "файловых дескрипторов B, может быть обрезан список файловых " "дескрипторов). Если для входящих вспомогательных данных буфер не был " "предусмотрен (т. е., поле I в структуре I, указанное " "B(2), равно NULL), то входящие вспомогательные данные " "отбрасываются. В обоих случаях, в возвращаемом значении B(2) в " "I будет установлен флаг B." #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Ioctls" msgstr "Вызовы ioctl" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The following B(2) calls return information in I. The " "correct syntax is:" msgstr "" "Следующие вызовы B(2) возвращают информацию в аргументе I. " "Корректный синтаксис:" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "" "BI< value>B<;>\n" "IB< = ioctl(>IB<, >IB<, &>IB<);>\n" msgstr "" "BI< value>B<;>\n" "IB< = ioctl(>IB<, >IB<, &>IB<);>\n" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "I can be:" 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" #. #-#-#-#-# archlinux: unix.7.pot (PACKAGE VERSION) #-#-#-#-# #. FIXME . https://www.sourceware.org/bugzilla/show_bug.cgi?id=12002, #. filed 2010-09-10, may cause SIOCINQ to be defined in glibc headers #. SIOCOUTQ also has an effect for UNIX domain sockets, but not #. quite what userland might expect. It seems to return the number #. of bytes allocated for buffers containing pending output. #. That number is normally larger than the number of bytes of pending #. output. Since this info is, from userland's point of view, imprecise, #. and it may well change, probably best not to document this now. #. type: Plain text #. #-#-#-#-# debian-bookworm: unix.7.pot (PACKAGE VERSION) #-#-#-#-# #. FIXME . http://sources.redhat.com/bugzilla/show_bug.cgi?id=12002, #. filed 2010-09-10, may cause SIOCINQ to be defined in glibc headers #. SIOCOUTQ also has an effect for UNIX domain sockets, but not #. quite what userland might expect. It seems to return the number #. of bytes allocated for buffers containing pending output. #. That number is normally larger than the number of bytes of pending #. output. Since this info is, from userland's point of view, imprecise, #. and it may well change, probably best not to document this now. #. type: Plain text #. #-#-#-#-# debian-unstable: unix.7.pot (PACKAGE VERSION) #-#-#-#-# #. FIXME . https://www.sourceware.org/bugzilla/show_bug.cgi?id=12002, #. filed 2010-09-10, may cause SIOCINQ to be defined in glibc headers #. SIOCOUTQ also has an effect for UNIX domain sockets, but not #. quite what userland might expect. It seems to return the number #. of bytes allocated for buffers containing pending output. #. That number is normally larger than the number of bytes of pending #. output. Since this info is, from userland's point of view, imprecise, #. and it may well change, probably best not to document this now. #. type: Plain text #. #-#-#-#-# fedora-40: unix.7.pot (PACKAGE VERSION) #-#-#-#-# #. FIXME . https://www.sourceware.org/bugzilla/show_bug.cgi?id=12002, #. filed 2010-09-10, may cause SIOCINQ to be defined in glibc headers #. SIOCOUTQ also has an effect for UNIX domain sockets, but not #. quite what userland might expect. It seems to return the number #. of bytes allocated for buffers containing pending output. #. That number is normally larger than the number of bytes of pending #. output. Since this info is, from userland's point of view, imprecise, #. and it may well change, probably best not to document this now. #. type: Plain text #. #-#-#-#-# fedora-rawhide: unix.7.pot (PACKAGE VERSION) #-#-#-#-# #. FIXME . https://www.sourceware.org/bugzilla/show_bug.cgi?id=12002, #. filed 2010-09-10, may cause SIOCINQ to be defined in glibc headers #. SIOCOUTQ also has an effect for UNIX domain sockets, but not #. quite what userland might expect. It seems to return the number #. of bytes allocated for buffers containing pending output. #. That number is normally larger than the number of bytes of pending #. output. Since this info is, from userland's point of view, imprecise, #. and it may well change, probably best not to document this now. #. type: Plain text #. #-#-#-#-# mageia-cauldron: unix.7.pot (PACKAGE VERSION) #-#-#-#-# #. FIXME . https://www.sourceware.org/bugzilla/show_bug.cgi?id=12002, #. filed 2010-09-10, may cause SIOCINQ to be defined in glibc headers #. SIOCOUTQ also has an effect for UNIX domain sockets, but not #. quite what userland might expect. It seems to return the number #. of bytes allocated for buffers containing pending output. #. That number is normally larger than the number of bytes of pending #. output. Since this info is, from userland's point of view, imprecise, #. and it may well change, probably best not to document this now. #. type: Plain text #. #-#-#-#-# opensuse-leap-15-6: unix.7.pot (PACKAGE VERSION) #-#-#-#-# #. FIXME . https://www.sourceware.org/bugzilla/show_bug.cgi?id=12002, #. filed 2010-09-10, may cause SIOCINQ to be defined in glibc headers #. SIOCOUTQ also has an effect for UNIX domain sockets, but not #. quite what userland might expect. It seems to return the number #. of bytes allocated for buffers containing pending output. #. That number is normally larger than the number of bytes of pending #. output. Since this info is, from userland's point of view, imprecise, #. and it may well change, probably best not to document this now. #. type: Plain text #. #-#-#-#-# opensuse-tumbleweed: unix.7.pot (PACKAGE VERSION) #-#-#-#-# #. FIXME . https://www.sourceware.org/bugzilla/show_bug.cgi?id=12002, #. filed 2010-09-10, may cause SIOCINQ to be defined in glibc headers #. SIOCOUTQ also has an effect for UNIX domain sockets, but not #. quite what userland might expect. It seems to return the number #. of bytes allocated for buffers containing pending output. #. That number is normally larger than the number of bytes of pending #. output. Since this info is, from userland's point of view, imprecise, #. and it may well change, probably best not to document this now. #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "For B sockets, this call returns the number of unread bytes in " "the receive buffer. The socket must not be in LISTEN state, otherwise an " "error (B) is returned. B is defined in Ilinux/" "sockios.hE>. Alternatively, you can use the synonymous B, " "defined in Isys/ioctl.hE>. For B sockets, the " "returned value is the same as for Internet domain datagram sockets; see " "B(7)." msgstr "" "Для сокетов B этот вызов возвращает количество непрочитанных " "данных в приёмном буфере. Сокет не должен быть в состоянии LISTEN, иначе " "возвращается ошибка (B). Значение B определено в " "Ilinux/sockios.hE>. В качестве альтернативы можно использовать " "синоним B, определённый в Isys/ioctl.hE>. Для сокетов " "B возвращаемое значение совпадает с дейтаграммными доменными " "сокетами Интернета; смотрите B(7)." #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "ERRORS" 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 specified local address is already in use or the filesystem socket " "object already exists." 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 "" "This error can occur for B(2) when sending a file descriptor as " "ancillary data over a UNIX domain socket (see the description of " "B, above), and indicates that the file descriptor number that is " "being sent is not valid (e.g., it is not an open file descriptor)." msgstr "" "Эта ошибка может возникать в B(2) при отправке файлового " "дескриптора в вспомогательных данных через доменный сокет UNIX (смотрите " "описание 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 remote address specified by B(2) was not a listening socket. " "This error can also occur if the target pathname is not a socket." msgstr "" "Удалённый адрес, указанный B(2) не является слушающим сокетом. Эта " "ошибка также может возникнуть, если путь назначения не является сокетом." #. 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 "Remote socket was unexpectedly closed." 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 "User memory address was not valid." 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 "" "Invalid argument passed. A common cause is that the value B was " "not specified in the I field of passed addresses, or the socket " "was in an invalid state for the applied operation." msgstr "" "Передан неправильный аргумент. Основная причина \\(em не задано значение " "B в поле 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 "" "B(2) called on an already connected socket or a target address was " "specified on a connected socket." msgstr "" "Вызов B(2) запущен для уже соединённого сокета, или адрес " "назначения указывает на соединённый сокет." #. 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 system-wide limit on the total number of open files has been reached." 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 pathname in the remote address specified to B(2) did not exist." msgstr "Путь, указанный в удалённом адресе для B(2), не существует." #. 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 "" "Socket operation needs a target address, but the socket is not connected." 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 "" "Stream operation called on non-stream oriented socket or tried to use the " "out-of-band data option." 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 sender passed invalid credentials in the I." msgstr "" "Отправитель указал неправильную информацию (credentials) в структуре " "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 "" "Remote socket was closed on a stream socket. If enabled, a B is " "sent as well. This can be avoided by passing the B flag to " "B(2) or B(2)." msgstr "" "Удалённый сокет был закрыт в потоковом сокете. Если разрешено, также будет " "послан сигнал B. Этого можно избежать, передав флаг B " "при вызове B(2) или B(2)." #. 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 "Passed protocol is not B." 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 "" "Remote socket does not match the local socket type (B versus " "B)." msgstr "" "Удалённый сокет не совпадает с типом локального сокета (B против " "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 "Unknown socket type." 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 "" "While sending an ancillary message containing credentials " "(B), the caller specified a PID that does not match any " "existing process." 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 "" "This error can occur for B(2) when sending a file descriptor as " "ancillary data over a UNIX domain socket (see the description of " "B, above). It occurs if the number of \"in-flight\" file " "descriptors exceeds the B resource limit and the caller does " "not have the B capability. An in-flight file descriptor " "is one that has been sent using B(2) but has not yet been accepted " "in the recipient process using B(2)." msgstr "" "Эта ошибка может возникнуть в B(2) при передаче через доменный " "сокет UNIX в качестве вспомогательных данных файлового дескриптора (смотрите " "описание B выше). Это происходит, если количество файловых " "дескрипторов «в полёте» превышает ограничитель ресурса B и " "вызывающий не имеет мандата B. Файловым дескриптором в " "полёте считается посланный с помощью B(2), но ещё не принятый " "процессом-получателем с помощью B(2)." #. commit 712f4aad406bb1ed67f3f98d04c044191f0ff593 #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "This error is diagnosed since mainline Linux 4.5 (and in some earlier kernel " "versions where the fix has been backported). In earlier kernel versions, it " "was possible to place an unlimited number of file descriptors in flight, by " "sending each file descriptor with B(2) and then closing the file " "descriptor so that it was not accounted against the B " "resource limit." msgstr "" "Данная ошибка выявляется начиная с Linux 4.5 (и в некоторых старых версиях, " "в которые перенесено исправление). В ранних версиях ядра было возможно " "получить неограниченное количество файловых дескрипторов в полёте, посылая " "каждый файловый дескриптор с помощью B(2) и затем закрывая файловый " "дескриптор, и таким образом он не учитывался в ограничителе ресурса " "B." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Other errors can be generated by the generic socket layer or by the " "filesystem while generating a filesystem socket object. See the appropriate " "manual pages for more information." msgstr "" "При создании сокетного объекта на уровне сокетов или файловой системы могут " "генерироваться другие ошибки. За дополнительной информацией обращайтесь к " "соответствующей справочной странице." #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "VERSIONS" msgstr "ВЕРСИИ" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "B and the abstract namespace were introduced with Linux 2.2 " "and should not be used in portable programs. (Some BSD-derived systems also " "support credential passing, but the implementation details differ.)" msgstr "" "B и абстрактное пространство имён появились в Linux 2.2 и " "не должны использоваться в переносимых программах. Некоторые клоны BSD также " "поддерживают передачу дополнительной информации (credential), но методы " "реализации передачи могут серьезно отличаться на разных системах." #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "NOTES" msgstr "ПРИМЕЧАНИЯ" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Binding to a socket with a filename creates a socket in the filesystem that " "must be deleted by the caller when it is no longer needed (using " "B(2)). The usual UNIX close-behind semantics apply; the socket can " "be unlinked at any time and will be finally removed from the filesystem when " "the last reference to it is closed." msgstr "" "Привязка сокета к имени файла создаёт сокет в файловой системе, который " "должен быть удалён создателем, когда необходимость в нём отпадёт (с помощью " "B(2)). Обычная система ссылок UNIX также подходит для работы с " "сокетами; сокет может быть удалён в любое время, а реальное удаление из " "файловой системы будет произведено при закрытии последней на него ссылки." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, fuzzy #| msgid "" #| "To pass file descriptors or credentials over a B socket, you " #| "must to send or receive at least one byte of nonancillary data in the " #| "same B(2) or B(2) call." msgid "" "To pass file descriptors or credentials over a B socket, you " "must send or receive at least one byte of nonancillary data in the same " "B(2) or B(2) call." msgstr "" "Для передачи файловых дескрипторов или учётных данных (credentials) через " "сокет B необходимо передать или принять, по меньшей мере, один " "байт не вспомогательных данных в том же вызове B(2) или " "B(2)." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "UNIX domain stream sockets do not support the notion of out-of-band data." msgstr "" "В потоковых доменных сокетах UNIX отсутствует такое понятие как внеполосные " "данные." #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "BUGS" msgstr "ОШИБКИ" #. The behavior on Solaris is quite similar. #. type: Plain text #: archlinux debian-unstable fedora-rawhide opensuse-tumbleweed #, fuzzy #| msgid "" #| "When binding a socket to an address, Linux is one of the implementations " #| "that appends a null terminator if none is supplied in I. In " #| "most cases this is unproblematic: when the socket address is retrieved, " #| "it will be one byte longer than that supplied when the socket was bound. " #| "However, there is one case where confusing behavior can result: if 108 " #| "non-null bytes are supplied when a socket is bound, then the addition of " #| "the null terminator takes the length of the pathname beyond " #| "I. Consequently, when retrieving the socket address " #| "(for example, via B(2)), if the input I argument for the " #| "retrieving call is specified as I, then the " #| "returned address structure I have a null terminator in I." msgid "" "When binding a socket to an address, Linux is one of the implementations " "that append a null terminator if none is supplied in I. In most " "cases this is unproblematic: when the socket address is retrieved, it will " "be one byte longer than that supplied when the socket was bound. However, " "there is one case where confusing behavior can result: if 108 non-null bytes " "are supplied when a socket is bound, then the addition of the null " "terminator takes the length of the pathname beyond I. " "Consequently, when retrieving the socket address (for example, via " "B(2)), if the input I argument for the retrieving call is " "specified as I, then the returned address " "structure I have a null terminator in I." msgstr "" "При привязке сокета к адресу Linux является одной из реализаций, которые " "добавляют конечный null, если он отсутствует в I. В большинстве " "случаев в этом нет проблемы: когда адрес сокета возвращается, он будет на " "один байт длиннее чем был перед привязкой сокета. Однако такое неожиданное " "поведение может привести к следующему: если передаётся 108 не-null байтов " "при привязке сокета, то с дополнительным конечным null пути превышает длину " "I. В последствии при возврате адреса сокета (например, из " "B(2)), если входной аргумент I перед вызовом был равен " "I, то в I возвращаемой структуры " "адреса I<будет отсутствовать> конечный null." #. i.e., traditional BSD #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "In addition, some implementations don't require a null terminator when " "binding a socket (the I argument is used to determine the length of " "I) and when the socket address is retrieved on these " "implementations, there is no null terminator in I." msgstr "" "Также, некоторые реализации не требуют наличия конечного null при привязке " "сокета (для определения длины I используется аргумент I) " "и когда в этих реализациях возвращается адрес сокета, то в I также " "отсутствует конечный null." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Applications that retrieve socket addresses can (portably) code to handle " "the possibility that there is no null terminator in I by " "respecting the fact that the number of valid bytes in the pathname is:" msgstr "" "Приложения, которые получают адрес сокета могут содержать код (переносимый) " "для обработки случая, когда нет конечного null в I, учитывая " "фактическое количество пригодных байт в пути:" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid " strnlen(addr.sun_path, addrlen - offsetof(sockaddr_un, sun_path))\n" msgid "strnlen(addr.sun_path, addrlen - offsetof(sockaddr_un, sun_path))\n" msgstr " strnlen(addr.sun_path, addrlen - offsetof(sockaddr_un, sun_path))\n" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Alternatively, an application can retrieve the socket address by allocating " "a buffer of size I that is zeroed out before " "the retrieval. The retrieving call can specify I as " "I, and the extra zero byte ensures that there " "will be a null terminator for the string returned in I:" msgstr "" "Или же приложение может перед получением адреса сокета выделить буфер " "размера I, который будет обнулён перед " "возвращением. Возвращающий вызов может задать в I значение " "I, и дополнительный нулевой байт здесь будет " "конечным null в строке, возвращаемой в I:" #. type: Plain text #: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron #: opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "" #| "addrlen = sizeof(struct sockaddr_un);\n" #| "addrp = malloc(addrlen + 1);\n" #| "if (addrp == NULL)\n" #| " /* Handle error */ ;\n" #| "memset(addrp, 0, addrlen + 1);\n" msgid "" "void *addrp;\n" "\\&\n" "addrlen = sizeof(struct sockaddr_un);\n" "addrp = malloc(addrlen + 1);\n" "if (addrp == NULL)\n" " /* Handle error */ ;\n" "memset(addrp, 0, addrlen + 1);\n" "\\&\n" "if (getsockname(sfd, (struct sockaddr *) addrp, &addrlen)) == -1)\n" " /* handle error */ ;\n" "\\&\n" "printf(\"sun_path = %s\\en\", ((struct sockaddr_un *) addrp)-Esun_path);\n" msgstr "" "addrlen = sizeof(struct sockaddr_un);\n" "addrp = malloc(addrlen + 1);\n" "if (addrp == NULL)\n" " /* обработка ошибки */ ;\n" "memset(addrp, 0, addrlen + 1);\n" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "This sort of messiness can be avoided if it is guaranteed that the " "applications that I pathname sockets follow the rules outlined above " "under I." msgstr "" "Данного беспорядка можно избежать, если гарантировать, что приложения, " "I<создающие> путевые сокеты, следуют правилам, описанным в общих чертах выше " "в I<Путевые сокеты>." #. 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 "" "The following code demonstrates the use of sequenced-packet sockets for " "local interprocess communication. It consists of two programs. The server " "program waits for a connection from the client program. The client sends " "each of its command-line arguments in separate messages. The server treats " "the incoming messages as integers and adds them up. The client sends the " "command string \"END\". The server sends back a message containing the sum " "of the client's integers. The client prints the sum and exits. The server " "waits for the next client to connect. To stop the server, the client is " "called with the command-line argument \"DOWN\"." msgstr "" "В следующем коде демонстрируется использование пакето-упорядочивающих " "сокетов для локального межпроцессного обмена. Он состоит из двух программ. " "Программа-сервер ждёт подключения программы-клиента. Клиент посылает свой " "каждый аргумент командной строки в виде отдельного сообщения. Сервер считает " "входящие сообщения как целые числа и складывает их. Клиент посылает строку-" "команду «END». Сервер посылает ответное сообщение, содержащее сумму чисел " "клиента. Клиент печатает сумму и завершает работу. Сервер ждёт подключение " "следующего клиента. Для остановки сервера, клиент вызывается с аргументом " "командной строки «DOWN»." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The following output was recorded while running the server in the background " "and repeatedly executing the client. Execution of the server program ends " "when it receives the \"DOWN\" command." msgstr "" "Следующий вывод был записан при работе сервера в фоновом режиме и " "повторяющемся запуске клиента. Выполнение программы-сервера завершилось " "после получения им команды «DOWN»." #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Example output" 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<./server &>\n" "[1] 25887\n" "$ B<./client 3 4>\n" "Result = 7\n" "$ B<./client 11 -5>\n" "Result = 6\n" "$ B<./client DOWN>\n" "Result = 0\n" "[1]+ Done ./server\n" "$\n" msgstr "" "$ B<./server &>\n" "[1] 25887\n" "$ B<./client 3 4>\n" "Результат = 7\n" "$ B<./client 11 -5>\n" "Результат = 6\n" "$ B<./client DOWN>\n" "Результат = 0\n" "[1]+ Done ./server\n" "$\n" #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Program source" msgstr "Исходный код программы" #. type: Plain text #: archlinux debian-unstable opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "" #| "#define SOCKET_NAME \"/tmp/9Lq7BNBnBycd6nxy.socket\"\n" #| "#define BUFFER_SIZE 12\n" msgid "" "/*\n" " * File connection.h\n" " */\n" "#ifndef CONNECTION_H\n" "#define CONNECTION_H\n" "\\&\n" "#define SOCKET_NAME \"/tmp/9Lq7BNBnBycd6nxy.socket\"\n" "#define BUFFER_SIZE 12\n" "\\&\n" "#endif // include guard\n" msgstr "" "#define SOCKET_NAME \"/tmp/9Lq7BNBnBycd6nxy.socket\"\n" "#define BUFFER_SIZE 12\n" #. type: Plain text #: archlinux debian-unstable opensuse-tumbleweed #, no-wrap msgid "" "/*\n" " * File server.c\n" " */\n" "\\&\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Estring.hE\n" "#include Esys/socket.hE\n" "#include Esys/types.hE\n" "#include Esys/un.hE\n" "#include Eunistd.hE\n" "\\&\n" "#include \"connection.h\"\n" "\\&\n" "int\n" "main(void)\n" "{\n" " int down_flag = 0;\n" " int ret;\n" " int connection_socket;\n" " int data_socket;\n" " int result;\n" " ssize_t r, w;\n" " struct sockaddr_un name;\n" " char buffer[BUFFER_SIZE];\n" "\\&\n" " /* Create local socket. */\n" "\\&\n" " connection_socket = socket(AF_UNIX, SOCK_SEQPACKET, 0);\n" " if (connection_socket == -1) {\n" " perror(\"socket\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /*\n" " * For portability clear the whole structure, since some\n" " * implementations have additional (nonstandard) fields in\n" " * the structure.\n" " */\n" "\\&\n" " memset(&name, 0, sizeof(name));\n" "\\&\n" " /* Bind socket to socket name. */\n" "\\&\n" " name.sun_family = AF_UNIX;\n" " strncpy(name.sun_path, SOCKET_NAME, sizeof(name.sun_path) - 1);\n" "\\&\n" " ret = bind(connection_socket, (const struct sockaddr *) &name,\n" " sizeof(name));\n" " if (ret == -1) {\n" " perror(\"bind\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /*\n" " * Prepare for accepting connections. The backlog size is set\n" " * to 20. So while one request is being processed other requests\n" " * can be waiting.\n" " */\n" "\\&\n" " ret = listen(connection_socket, 20);\n" " if (ret == -1) {\n" " perror(\"listen\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* This is the main loop for handling connections. */\n" "\\&\n" " for (;;) {\n" "\\&\n" " /* Wait for incoming connection. */\n" "\\&\n" " data_socket = accept(connection_socket, NULL, NULL);\n" " if (data_socket == -1) {\n" " perror(\"accept\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " result = 0;\n" " for (;;) {\n" "\\&\n" " /* Wait for next data packet. */\n" "\\&\n" " r = read(data_socket, buffer, sizeof(buffer));\n" " if (r == -1) {\n" " perror(\"read\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Ensure buffer is 0-terminated. */\n" "\\&\n" " buffer[sizeof(buffer) - 1] = 0;\n" "\\&\n" " /* Handle commands. */\n" "\\&\n" " if (!strncmp(buffer, \"DOWN\", sizeof(buffer))) {\n" " down_flag = 1;\n" " continue;\n" " }\n" "\\&\n" " if (!strncmp(buffer, \"END\", sizeof(buffer))) {\n" " break;\n" " }\n" "\\&\n" " if (down_flag) {\n" " continue;\n" " }\n" "\\&\n" " /* Add received summand. */\n" "\\&\n" " result += atoi(buffer);\n" " }\n" "\\&\n" " /* Send result. */\n" "\\&\n" " sprintf(buffer, \"%d\", result);\n" " w = write(data_socket, buffer, sizeof(buffer));\n" " if (w == -1) {\n" " perror(\"write\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Close socket. */\n" "\\&\n" " close(data_socket);\n" "\\&\n" " /* Quit on DOWN command. */\n" "\\&\n" " if (down_flag) {\n" " break;\n" " }\n" " }\n" "\\&\n" " close(connection_socket);\n" "\\&\n" " /* Unlink the socket. */\n" "\\&\n" " unlink(SOCKET_NAME);\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" #. type: Plain text #: archlinux debian-unstable opensuse-tumbleweed #, no-wrap msgid "" "/*\n" " * File client.c\n" " */\n" "\\&\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Estring.hE\n" "#include Esys/socket.hE\n" "#include Esys/types.hE\n" "#include Esys/un.hE\n" "#include Eunistd.hE\n" "\\&\n" "#include \"connection.h\"\n" "\\&\n" "int\n" "main(int argc, char *argv[])\n" "{\n" " int ret;\n" " int data_socket;\n" " ssize_t r, w;\n" " struct sockaddr_un addr;\n" " char buffer[BUFFER_SIZE];\n" "\\&\n" " /* Create local socket. */\n" "\\&\n" " data_socket = socket(AF_UNIX, SOCK_SEQPACKET, 0);\n" " if (data_socket == -1) {\n" " perror(\"socket\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /*\n" " * For portability clear the whole structure, since some\n" " * implementations have additional (nonstandard) fields in\n" " * the structure.\n" " */\n" "\\&\n" " memset(&addr, 0, sizeof(addr));\n" "\\&\n" " /* Connect socket to socket address. */\n" "\\&\n" " addr.sun_family = AF_UNIX;\n" " strncpy(addr.sun_path, SOCKET_NAME, sizeof(addr.sun_path) - 1);\n" "\\&\n" " ret = connect(data_socket, (const struct sockaddr *) &addr,\n" " sizeof(addr));\n" " if (ret == -1) {\n" " fprintf(stderr, \"The server is down.\\en\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Send arguments. */\n" "\\&\n" " for (int i = 1; i E argc; ++i) {\n" " w = write(data_socket, argv[i], strlen(argv[i]) + 1);\n" " if (w == -1) {\n" " perror(\"write\");\n" " break;\n" " }\n" " }\n" "\\&\n" " /* Request result. */\n" "\\&\n" " strcpy(buffer, \"END\");\n" " w = write(data_socket, buffer, strlen(buffer) + 1);\n" " if (w == -1) {\n" " perror(\"write\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Receive result. */\n" "\\&\n" " r = read(data_socket, buffer, sizeof(buffer));\n" " if (r == -1) {\n" " perror(\"read\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Ensure buffer is 0-terminated. */\n" "\\&\n" " buffer[sizeof(buffer) - 1] = 0;\n" "\\&\n" " printf(\"Result = %s\\en\", buffer);\n" "\\&\n" " /* Close socket. */\n" "\\&\n" " close(data_socket);\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, fuzzy #| msgid "For an example of the use of B see B(3)." msgid "" "For examples of the use of B, see B(3) and " "B(2)." 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 "SEE ALSO" msgstr "СМОТРИТЕ ТАКЖЕ" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "B(2), B(2), B(2), B(2), B(3), " "B(7), B(7), B(7), B(7)" msgstr "" "B(2), B(2), B(2), B(2), B(3), " "B(7), B(7), B(7), B(7)" #. type: TH #: debian-bookworm #, no-wrap msgid "2023-02-10" msgstr "10 февраля 2023 г." #. type: TH #: debian-bookworm #, no-wrap msgid "Linux man-pages 6.03" msgstr "Linux man-pages 6.03" #. type: Plain text #: debian-bookworm fedora-40 mageia-cauldron opensuse-leap-15-6 msgid "" "Various systems calls (for example, B(2), B(2), and " "B(2)) take a I argument as input. Some other system " "calls (for example, B(2), B(2), B(2), " "and B(2)) return an argument of this type." msgstr "" "В различных системных вызовах (например, B(2), B(2) и " "B(2)) в качестве входных данных используется параметр " "I. Другие системные вызовы (например, B(2), " "B(2), B(2) и B(2)) возвращают результат в " "параметре этого типа." #. type: Plain text #: debian-bookworm opensuse-leap-15-6 msgid "" "This read-only socket option returns the credentials of the peer process " "connected to this socket. The returned credentials are those that were in " "effect at the time of the call to B(2) or B(2)." msgstr "" "С параметром сокета, доступным только для чтения, возвращаются учётные " "данные однорангового процесса, соединённого с сокетом. Возвращаются " "информационные данные, которые были действительными на момент вызова " "B(2) или B(2)." #. The behavior on Solaris is quite similar. #. type: Plain text #: debian-bookworm fedora-40 mageia-cauldron opensuse-leap-15-6 msgid "" "When binding a socket to an address, Linux is one of the implementations " "that appends a null terminator if none is supplied in I. In most " "cases this is unproblematic: when the socket address is retrieved, it will " "be one byte longer than that supplied when the socket was bound. However, " "there is one case where confusing behavior can result: if 108 non-null bytes " "are supplied when a socket is bound, then the addition of the null " "terminator takes the length of the pathname beyond I. " "Consequently, when retrieving the socket address (for example, via " "B(2)), if the input I argument for the retrieving call is " "specified as I, then the returned address " "structure I have a null terminator in I." msgstr "" "При привязке сокета к адресу Linux является одной из реализаций, которые " "добавляют конечный null, если он отсутствует в I. В большинстве " "случаев в этом нет проблемы: когда адрес сокета возвращается, он будет на " "один байт длиннее чем был перед привязкой сокета. Однако такое неожиданное " "поведение может привести к следующему: если передаётся 108 не-null байтов " "при привязке сокета, то с дополнительным конечным null пути превышает длину " "I. В последствии при возврате адреса сокета (например, из " "B(2)), если входной аргумент I перед вызовом был равен " "I, то в I возвращаемой структуры " "адреса I<будет отсутствовать> конечный null." #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "void *addrp;\n" msgstr "void *addrp;\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" "addrlen = sizeof(struct sockaddr_un);\n" "addrp = malloc(addrlen + 1);\n" "if (addrp == NULL)\n" " /* Handle error */ ;\n" "memset(addrp, 0, addrlen + 1);\n" msgstr "" "addrlen = sizeof(struct sockaddr_un);\n" "addrp = malloc(addrlen + 1);\n" "if (addrp == NULL)\n" " /* обработка ошибки */ ;\n" "memset(addrp, 0, addrlen + 1);\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" "if (getsockname(sfd, (struct sockaddr *) addrp, &addrlen)) == -1)\n" " /* handle error */ ;\n" msgstr "" "if (getsockname(sfd, (struct sockaddr *) addrp, &addrlen)) == -1)\n" " /* обработка ошибки */ ;\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "printf(\"sun_path = %s\\en\", ((struct sockaddr_un *) addrp)-Esun_path);\n" msgstr "printf(\"sun_path = %s\\en\", ((struct sockaddr_un *) addrp)-Esun_path);\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" "/*\n" " * File connection.h\n" " */\n" msgstr "" "/*\n" " * Файл connection.h\n" " */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" "#define SOCKET_NAME \"/tmp/9Lq7BNBnBycd6nxy.socket\"\n" "#define BUFFER_SIZE 12\n" msgstr "" "#define SOCKET_NAME \"/tmp/9Lq7BNBnBycd6nxy.socket\"\n" "#define BUFFER_SIZE 12\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" "/*\n" " * File server.c\n" " */\n" msgstr "" "/*\n" " * Файл server.c\n" " */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Estring.hE\n" "#include Esys/socket.hE\n" "#include Esys/un.hE\n" "#include Eunistd.hE\n" "#include \"connection.h\"\n" msgstr "" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Estring.hE\n" "#include Esys/socket.hE\n" "#include Esys/un.hE\n" "#include Eunistd.hE\n" "#include \"connection.h\"\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" "int\n" "main(int argc, char *argv[])\n" "{\n" " struct sockaddr_un name;\n" " int down_flag = 0;\n" " int ret;\n" " int connection_socket;\n" " int data_socket;\n" " int result;\n" " char buffer[BUFFER_SIZE];\n" msgstr "" "int\n" "main(int argc, char *argv[])\n" "{\n" " struct sockaddr_un name;\n" " int down_flag = 0;\n" " int ret;\n" " int connection_socket;\n" " int data_socket;\n" " int result;\n" " char buffer[BUFFER_SIZE];\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* Create local socket. */\n" msgstr " /* Создание локального сокета. */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " connection_socket = socket(AF_UNIX, SOCK_SEQPACKET, 0);\n" " if (connection_socket == -1) {\n" " perror(\"socket\");\n" " exit(EXIT_FAILURE);\n" " }\n" msgstr "" " connection_socket = socket(AF_UNIX, SOCK_SEQPACKET, 0);\n" " if (connection_socket == -1) {\n" " perror(\"socket\");\n" " exit(EXIT_FAILURE);\n" " }\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " /*\n" " * For portability clear the whole structure, since some\n" " * implementations have additional (nonstandard) fields in\n" " * the structure.\n" " */\n" msgstr "" " /*\n" " * Для переносимости очищаем всю структуру, так как в некоторых\n" " * реализациях имеются дополнительные (нестандартные) поля.\n" " */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid " memset(&name, 0, sizeof(struct sockaddr_un));\n" msgid " memset(&name, 0, sizeof(name));\n" msgstr " memset(&name, 0, sizeof(struct sockaddr_un));\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* Bind socket to socket name. */\n" msgstr " /* Привязываем сокет к имени сокета. */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " name.sun_family = AF_UNIX;\n" " strncpy(name.sun_path, SOCKET_NAME, sizeof(name.sun_path) - 1);\n" msgstr "" " name.sun_family = AF_UNIX;\n" " strncpy(name.sun_path, SOCKET_NAME, sizeof(name.sun_path) - 1);\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid "" #| " ret = bind(connection_socket, (const struct sockaddr *) &name,\n" #| " sizeof(struct sockaddr_un));\n" #| " if (ret == -1) {\n" #| " perror(\"bind\");\n" #| " exit(EXIT_FAILURE);\n" #| " }\n" msgid "" " ret = bind(connection_socket, (const struct sockaddr *) &name,\n" " sizeof(name));\n" " if (ret == -1) {\n" " perror(\"bind\");\n" " exit(EXIT_FAILURE);\n" " }\n" msgstr "" " ret = bind(connection_socket, (const struct sockaddr *) &name,\n" " sizeof(struct sockaddr_un));\n" " if (ret == -1) {\n" " perror(\"bind\");\n" " exit(EXIT_FAILURE);\n" " }\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " /*\n" " * Prepare for accepting connections. The backlog size is set\n" " * to 20. So while one request is being processed other requests\n" " * can be waiting.\n" " */\n" msgstr "" " /*\n" " * Готовимся принимать подключения. Размер очереди (backlog)\n" " * устанавливаем равным 20. Пока один запрос обрабатывается, другие\n" " * запросы смогут подождать.\n" " */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " ret = listen(connection_socket, 20);\n" " if (ret == -1) {\n" " perror(\"listen\");\n" " exit(EXIT_FAILURE);\n" " }\n" msgstr "" " ret = listen(connection_socket, 20);\n" " if (ret == -1) {\n" " perror(\"listen\");\n" " exit(EXIT_FAILURE);\n" " }\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* This is the main loop for handling connections. */\n" msgstr " /* Основной цикл обработки подключений. */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " for (;;) {\n" msgstr " for (;;) {\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* Wait for incoming connection. */\n" msgstr " /* Ожидание входящих подключений. */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " data_socket = accept(connection_socket, NULL, NULL);\n" " if (data_socket == -1) {\n" " perror(\"accept\");\n" " exit(EXIT_FAILURE);\n" " }\n" msgstr "" " data_socket = accept(connection_socket, NULL, NULL);\n" " if (data_socket == -1) {\n" " perror(\"accept\");\n" " exit(EXIT_FAILURE);\n" " }\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " result = 0;\n" " for (;;) {\n" msgstr "" " result = 0;\n" " for (;;) {\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* Wait for next data packet. */\n" msgstr " /* Ожидание следующего пакета с данными. */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid "" #| " ret = read(data_socket, buffer, BUFFER_SIZE);\n" #| " if (ret == -1) {\n" #| " perror(\"read\");\n" #| " exit(EXIT_FAILURE);\n" #| " }\n" msgid "" " ret = read(data_socket, buffer, sizeof(buffer));\n" " if (ret == -1) {\n" " perror(\"read\");\n" " exit(EXIT_FAILURE);\n" " }\n" msgstr "" " ret = read(data_socket, buffer, BUFFER_SIZE);\n" " if (ret == -1) {\n" " perror(\"read\");\n" " exit(EXIT_FAILURE);\n" " }\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* Ensure buffer is 0-terminated. */\n" msgstr " /* Проверяем, что буфер завершается 0. */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid " buffer[BUFFER_SIZE - 1] = 0;\n" msgid " buffer[sizeof(buffer) - 1] = 0;\n" msgstr " buffer[BUFFER_SIZE - 1] = 0;\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* Handle commands. */\n" msgstr " /* Обработка команд. */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid "" #| " if (!strncmp(buffer, \"DOWN\", BUFFER_SIZE)) {\n" #| " down_flag = 1;\n" #| " break;\n" #| " }\n" msgid "" " if (!strncmp(buffer, \"DOWN\", sizeof(buffer))) {\n" " down_flag = 1;\n" " break;\n" " }\n" msgstr "" " if (!strncmp(buffer, \"DOWN\", BUFFER_SIZE)) {\n" " down_flag = 1;\n" " break;\n" " }\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid "" #| " if (!strncmp(buffer, \"END\", BUFFER_SIZE)) {\n" #| " break;\n" #| " }\n" msgid "" " if (!strncmp(buffer, \"END\", sizeof(buffer))) {\n" " break;\n" " }\n" msgstr "" " if (!strncmp(buffer, \"END\", BUFFER_SIZE)) {\n" " break;\n" " }\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* Add received summand. */\n" msgstr " /* Добавляем полученную команду. */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " result += atoi(buffer);\n" " }\n" msgstr "" " result += atoi(buffer);\n" " }\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* Send result. */\n" msgstr " /* Отправка результата. */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid "" #| " sprintf(buffer, \"%d\", result);\n" #| " ret = write(data_socket, buffer, BUFFER_SIZE);\n" #| " if (ret == -1) {\n" #| " perror(\"write\");\n" #| " exit(EXIT_FAILURE);\n" #| " }\n" msgid "" " sprintf(buffer, \"%d\", result);\n" " ret = write(data_socket, buffer, sizeof(buffer));\n" " if (ret == -1) {\n" " perror(\"write\");\n" " exit(EXIT_FAILURE);\n" " }\n" msgstr "" " sprintf(buffer, \"%d\", result);\n" " ret = write(data_socket, buffer, BUFFER_SIZE);\n" " if (ret == -1) {\n" " perror(\"write\");\n" " exit(EXIT_FAILURE);\n" " }\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* Close socket. */\n" msgstr " /* Закрытие сокета. */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " close(data_socket);\n" msgstr " close(data_socket);\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* Quit on DOWN command. */\n" msgstr " /* Завершаем работу по команде DOWN. */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " if (down_flag) {\n" " break;\n" " }\n" " }\n" msgstr "" " if (down_flag) {\n" " break;\n" " }\n" " }\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " close(connection_socket);\n" msgstr " close(connection_socket);\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* Unlink the socket. */\n" msgstr " /* Удаляем сокет. */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " unlink(SOCKET_NAME);\n" msgstr " unlink(SOCKET_NAME);\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" " exit(EXIT_SUCCESS);\n" "}\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" "/*\n" " * File client.c\n" " */\n" msgstr "" "/*\n" " * Файл client.c\n" " */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" "#include Eerrno.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Estring.hE\n" "#include Esys/socket.hE\n" "#include Esys/un.hE\n" "#include Eunistd.hE\n" "#include \"connection.h\"\n" msgstr "" "#include Eerrno.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Estring.hE\n" "#include Esys/socket.hE\n" "#include Esys/un.hE\n" "#include Eunistd.hE\n" "#include \"connection.h\"\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid "" #| "int\n" #| "main(int argc, char *argv[])\n" #| "{\n" #| " struct sockaddr_un addr;\n" #| " int i;\n" #| " int ret;\n" #| " int data_socket;\n" #| " char buffer[BUFFER_SIZE];\n" msgid "" "int\n" "main(int argc, char *argv[])\n" "{\n" " struct sockaddr_un addr;\n" " int ret;\n" " int data_socket;\n" " char buffer[BUFFER_SIZE];\n" msgstr "" "int\n" "main(int argc, char *argv[])\n" "{\n" " struct sockaddr_un addr;\n" " int i;\n" " int ret;\n" " int data_socket;\n" " char buffer[BUFFER_SIZE];\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " data_socket = socket(AF_UNIX, SOCK_SEQPACKET, 0);\n" " if (data_socket == -1) {\n" " perror(\"socket\");\n" " exit(EXIT_FAILURE);\n" " }\n" msgstr "" " data_socket = socket(AF_UNIX, SOCK_SEQPACKET, 0);\n" " if (data_socket == -1) {\n" " perror(\"socket\");\n" " exit(EXIT_FAILURE);\n" " }\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid " memset(&addr, 0, sizeof(struct sockaddr_un));\n" msgid " memset(&addr, 0, sizeof(addr));\n" msgstr " memset(&addr, 0, sizeof(struct sockaddr_un));\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid " /* Connect socket to socket address */\n" msgid " /* Connect socket to socket address. */\n" msgstr " /* соединяем сокет с адресом сокета */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " addr.sun_family = AF_UNIX;\n" " strncpy(addr.sun_path, SOCKET_NAME, sizeof(addr.sun_path) - 1);\n" msgstr "" " addr.sun_family = AF_UNIX;\n" " strncpy(addr.sun_path, SOCKET_NAME, sizeof(addr.sun_path) - 1);\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid "" #| " ret = connect (data_socket, (const struct sockaddr *) &addr,\n" #| " sizeof(struct sockaddr_un));\n" #| " if (ret == -1) {\n" #| " fprintf(stderr, \"The server is down.\\en\");\n" #| " exit(EXIT_FAILURE);\n" #| " }\n" msgid "" " ret = connect(data_socket, (const struct sockaddr *) &addr,\n" " sizeof(addr));\n" " if (ret == -1) {\n" " fprintf(stderr, \"The server is down.\\en\");\n" " exit(EXIT_FAILURE);\n" " }\n" msgstr "" " ret = connect (data_socket, (const struct sockaddr *) &addr,\n" " sizeof(struct sockaddr_un));\n" " if (ret == -1) {\n" " fprintf(stderr, \"The server is down.\\en\");\n" " exit(EXIT_FAILURE);\n" " }\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* Send arguments. */\n" msgstr " /* Посылаем аргументы. */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid "" #| " for (i = 1; i E argc; ++i) {\n" #| " ret = write(data_socket, argv[i], strlen(argv[i]) + 1);\n" #| " if (ret == -1) {\n" #| " perror(\"write\");\n" #| " break;\n" #| " }\n" #| " }\n" msgid "" " for (size_t i = 1; i E argc; ++i) {\n" " ret = write(data_socket, argv[i], strlen(argv[i]) + 1);\n" " if (ret == -1) {\n" " perror(\"write\");\n" " break;\n" " }\n" " }\n" msgstr "" " for (i = 1; i E argc; ++i) {\n" " ret = write(data_socket, argv[i], strlen(argv[i]) + 1);\n" " if (ret == -1) {\n" " perror(\"write\");\n" " break;\n" " }\n" " }\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* Request result. */\n" msgstr " /* Отправка результата. */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid "" #| " strcpy (buffer, \"END\");\n" #| " ret = write(data_socket, buffer, strlen(buffer) + 1);\n" #| " if (ret == -1) {\n" #| " perror(\"write\");\n" #| " exit(EXIT_FAILURE);\n" #| " }\n" msgid "" " strcpy(buffer, \"END\");\n" " ret = write(data_socket, buffer, strlen(buffer) + 1);\n" " if (ret == -1) {\n" " perror(\"write\");\n" " exit(EXIT_FAILURE);\n" " }\n" msgstr "" " strcpy (buffer, \"END\");\n" " ret = write(data_socket, buffer, strlen(buffer) + 1);\n" " if (ret == -1) {\n" " perror(\"write\");\n" " exit(EXIT_FAILURE);\n" " }\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* Receive result. */\n" msgstr " /* Получение результата. */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid "" #| " ret = read(data_socket, buffer, BUFFER_SIZE);\n" #| " if (ret == -1) {\n" #| " perror(\"read\");\n" #| " exit(EXIT_FAILURE);\n" #| " }\n" msgid "" " ret = read(data_socket, buffer, sizeof(buffer));\n" " if (ret == -1) {\n" " perror(\"read\");\n" " exit(EXIT_FAILURE);\n" " }\n" msgstr "" " ret = read(data_socket, buffer, BUFFER_SIZE);\n" " if (ret == -1) {\n" " perror(\"read\");\n" " exit(EXIT_FAILURE);\n" " }\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* Ensure buffer is 0-terminated. */\n" msgstr " /* Проверяем, что буфер завершается 0. */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, fuzzy, no-wrap #| msgid " buffer[BUFFER_SIZE - 1] = 0;\n" msgid " buffer[sizeof(buffer) - 1] = 0;\n" msgstr " buffer[BUFFER_SIZE - 1] = 0;\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " printf(\"Result = %s\\en\", buffer);\n" msgstr " printf(\"Result = %s\\en\", buffer);\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* Close socket. */\n" msgstr " /* Закрытие сокета. */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " close(data_socket);\n" msgstr " close(data_socket);\n" #. type: TH #: fedora-40 mageia-cauldron #, no-wrap msgid "2023-12-21" msgstr "21 декабря 2023 г." #. type: TH #: fedora-40 mageia-cauldron #, no-wrap msgid "Linux man-pages 6.06" msgstr "Linux man-pages 6.06" #. type: Plain text #: fedora-40 mageia-cauldron #, no-wrap msgid "" "/*\n" " * File connection.h\n" " */\n" "\\&\n" "#define SOCKET_NAME \"/tmp/9Lq7BNBnBycd6nxy.socket\"\n" "#define BUFFER_SIZE 12\n" "\\&\n" "/*\n" " * File server.c\n" " */\n" "\\&\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Estring.hE\n" "#include Esys/socket.hE\n" "#include Esys/un.hE\n" "#include Eunistd.hE\n" "#include \"connection.h\"\n" "\\&\n" "int\n" "main(int argc, char *argv[])\n" "{\n" " struct sockaddr_un name;\n" " int down_flag = 0;\n" " int ret;\n" " int connection_socket;\n" " int data_socket;\n" " int result;\n" " char buffer[BUFFER_SIZE];\n" "\\&\n" " /* Create local socket. */\n" "\\&\n" " connection_socket = socket(AF_UNIX, SOCK_SEQPACKET, 0);\n" " if (connection_socket == -1) {\n" " perror(\"socket\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /*\n" " * For portability clear the whole structure, since some\n" " * implementations have additional (nonstandard) fields in\n" " * the structure.\n" " */\n" "\\&\n" " memset(&name, 0, sizeof(name));\n" "\\&\n" " /* Bind socket to socket name. */\n" "\\&\n" " name.sun_family = AF_UNIX;\n" " strncpy(name.sun_path, SOCKET_NAME, sizeof(name.sun_path) - 1);\n" "\\&\n" " ret = bind(connection_socket, (const struct sockaddr *) &name,\n" " sizeof(name));\n" " if (ret == -1) {\n" " perror(\"bind\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /*\n" " * Prepare for accepting connections. The backlog size is set\n" " * to 20. So while one request is being processed other requests\n" " * can be waiting.\n" " */\n" "\\&\n" " ret = listen(connection_socket, 20);\n" " if (ret == -1) {\n" " perror(\"listen\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* This is the main loop for handling connections. */\n" "\\&\n" " for (;;) {\n" "\\&\n" " /* Wait for incoming connection. */\n" "\\&\n" " data_socket = accept(connection_socket, NULL, NULL);\n" " if (data_socket == -1) {\n" " perror(\"accept\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " result = 0;\n" " for (;;) {\n" "\\&\n" " /* Wait for next data packet. */\n" "\\&\n" " ret = read(data_socket, buffer, sizeof(buffer));\n" " if (ret == -1) {\n" " perror(\"read\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Ensure buffer is 0-terminated. */\n" "\\&\n" " buffer[sizeof(buffer) - 1] = 0;\n" "\\&\n" " /* Handle commands. */\n" "\\&\n" " if (!strncmp(buffer, \"DOWN\", sizeof(buffer))) {\n" " down_flag = 1;\n" " break;\n" " }\n" "\\&\n" " if (!strncmp(buffer, \"END\", sizeof(buffer))) {\n" " break;\n" " }\n" "\\&\n" " /* Add received summand. */\n" "\\&\n" " result += atoi(buffer);\n" " }\n" "\\&\n" " /* Send result. */\n" "\\&\n" " sprintf(buffer, \"%d\", result);\n" " ret = write(data_socket, buffer, sizeof(buffer));\n" " if (ret == -1) {\n" " perror(\"write\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Close socket. */\n" "\\&\n" " close(data_socket);\n" "\\&\n" " /* Quit on DOWN command. */\n" "\\&\n" " if (down_flag) {\n" " break;\n" " }\n" " }\n" "\\&\n" " close(connection_socket);\n" "\\&\n" " /* Unlink the socket. */\n" "\\&\n" " unlink(SOCKET_NAME);\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" "\\&\n" "/*\n" " * File client.c\n" " */\n" "\\&\n" "#include Eerrno.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Estring.hE\n" "#include Esys/socket.hE\n" "#include Esys/un.hE\n" "#include Eunistd.hE\n" "#include \"connection.h\"\n" "\\&\n" "int\n" "main(int argc, char *argv[])\n" "{\n" " struct sockaddr_un addr;\n" " int ret;\n" " int data_socket;\n" " char buffer[BUFFER_SIZE];\n" "\\&\n" " /* Create local socket. */\n" "\\&\n" " data_socket = socket(AF_UNIX, SOCK_SEQPACKET, 0);\n" " if (data_socket == -1) {\n" " perror(\"socket\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /*\n" " * For portability clear the whole structure, since some\n" " * implementations have additional (nonstandard) fields in\n" " * the structure.\n" " */\n" "\\&\n" " memset(&addr, 0, sizeof(addr));\n" "\\&\n" " /* Connect socket to socket address. */\n" "\\&\n" " addr.sun_family = AF_UNIX;\n" " strncpy(addr.sun_path, SOCKET_NAME, sizeof(addr.sun_path) - 1);\n" "\\&\n" " ret = connect(data_socket, (const struct sockaddr *) &addr,\n" " sizeof(addr));\n" " if (ret == -1) {\n" " fprintf(stderr, \"The server is down.\\en\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Send arguments. */\n" "\\&\n" " for (size_t i = 1; i E argc; ++i) {\n" " ret = write(data_socket, argv[i], strlen(argv[i]) + 1);\n" " if (ret == -1) {\n" " perror(\"write\");\n" " break;\n" " }\n" " }\n" "\\&\n" " /* Request result. */\n" "\\&\n" " strcpy(buffer, \"END\");\n" " ret = write(data_socket, buffer, strlen(buffer) + 1);\n" " if (ret == -1) {\n" " perror(\"write\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Receive result. */\n" "\\&\n" " ret = read(data_socket, buffer, sizeof(buffer));\n" " if (ret == -1) {\n" " perror(\"read\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Ensure buffer is 0-terminated. */\n" "\\&\n" " buffer[sizeof(buffer) - 1] = 0;\n" "\\&\n" " printf(\"Result = %s\\en\", buffer);\n" "\\&\n" " /* Close socket. */\n" "\\&\n" " close(data_socket);\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" #. type: TH #: fedora-rawhide #, no-wrap msgid "2024-03-16" msgstr "16 марта 2024 г." #. type: TH #: fedora-rawhide #, no-wrap msgid "Linux man-pages 6.7" msgstr "Linux man-pages 6.7" #. type: Plain text #: fedora-rawhide #, fuzzy, no-wrap #| msgid "" #| "#define SOCKET_NAME \"/tmp/9Lq7BNBnBycd6nxy.socket\"\n" #| "#define BUFFER_SIZE 12\n" msgid "" "/*\n" " * File connection.h\n" " */\n" "\\&\n" "#define SOCKET_NAME \"/tmp/9Lq7BNBnBycd6nxy.socket\"\n" "#define BUFFER_SIZE 12\n" msgstr "" "#define SOCKET_NAME \"/tmp/9Lq7BNBnBycd6nxy.socket\"\n" "#define BUFFER_SIZE 12\n" #. type: Plain text #: fedora-rawhide #, no-wrap msgid "" "/*\n" " * File server.c\n" " */\n" "\\&\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Estring.hE\n" "#include Esys/socket.hE\n" "#include Esys/un.hE\n" "#include Eunistd.hE\n" "\\&\n" "#include \"connection.h\"\n" "\\&\n" "int\n" "main(void)\n" "{\n" " int down_flag = 0;\n" " int ret;\n" " int connection_socket;\n" " int data_socket;\n" " int result;\n" " ssize_t r, w;\n" " struct sockaddr_un name;\n" " char buffer[BUFFER_SIZE];\n" "\\&\n" " /* Create local socket. */\n" "\\&\n" " connection_socket = socket(AF_UNIX, SOCK_SEQPACKET, 0);\n" " if (connection_socket == -1) {\n" " perror(\"socket\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /*\n" " * For portability clear the whole structure, since some\n" " * implementations have additional (nonstandard) fields in\n" " * the structure.\n" " */\n" "\\&\n" " memset(&name, 0, sizeof(name));\n" "\\&\n" " /* Bind socket to socket name. */\n" "\\&\n" " name.sun_family = AF_UNIX;\n" " strncpy(name.sun_path, SOCKET_NAME, sizeof(name.sun_path) - 1);\n" "\\&\n" " ret = bind(connection_socket, (const struct sockaddr *) &name,\n" " sizeof(name));\n" " if (ret == -1) {\n" " perror(\"bind\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /*\n" " * Prepare for accepting connections. The backlog size is set\n" " * to 20. So while one request is being processed other requests\n" " * can be waiting.\n" " */\n" "\\&\n" " ret = listen(connection_socket, 20);\n" " if (ret == -1) {\n" " perror(\"listen\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* This is the main loop for handling connections. */\n" "\\&\n" " for (;;) {\n" "\\&\n" " /* Wait for incoming connection. */\n" "\\&\n" " data_socket = accept(connection_socket, NULL, NULL);\n" " if (data_socket == -1) {\n" " perror(\"accept\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " result = 0;\n" " for (;;) {\n" "\\&\n" " /* Wait for next data packet. */\n" "\\&\n" " r = read(data_socket, buffer, sizeof(buffer));\n" " if (r == -1) {\n" " perror(\"read\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Ensure buffer is 0-terminated. */\n" "\\&\n" " buffer[sizeof(buffer) - 1] = 0;\n" "\\&\n" " /* Handle commands. */\n" "\\&\n" " if (!strncmp(buffer, \"DOWN\", sizeof(buffer))) {\n" " down_flag = 1;\n" " continue;\n" " }\n" "\\&\n" " if (!strncmp(buffer, \"END\", sizeof(buffer))) {\n" " break;\n" " }\n" "\\&\n" " if (down_flag) {\n" " continue;\n" " }\n" "\\&\n" " /* Add received summand. */\n" "\\&\n" " result += atoi(buffer);\n" " }\n" "\\&\n" " /* Send result. */\n" "\\&\n" " sprintf(buffer, \"%d\", result);\n" " w = write(data_socket, buffer, sizeof(buffer));\n" " if (w == -1) {\n" " perror(\"write\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Close socket. */\n" "\\&\n" " close(data_socket);\n" "\\&\n" " /* Quit on DOWN command. */\n" "\\&\n" " if (down_flag) {\n" " break;\n" " }\n" " }\n" "\\&\n" " close(connection_socket);\n" "\\&\n" " /* Unlink the socket. */\n" "\\&\n" " unlink(SOCKET_NAME);\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" #. type: Plain text #: fedora-rawhide #, no-wrap msgid "" "/*\n" " * File client.c\n" " */\n" "\\&\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Estring.hE\n" "#include Esys/socket.hE\n" "#include Esys/un.hE\n" "#include Eunistd.hE\n" "\\&\n" "#include \"connection.h\"\n" "\\&\n" "int\n" "main(int argc, char *argv[])\n" "{\n" " int ret;\n" " int data_socket;\n" " ssize_t r, w;\n" " struct sockaddr_un addr;\n" " char buffer[BUFFER_SIZE];\n" "\\&\n" " /* Create local socket. */\n" "\\&\n" " data_socket = socket(AF_UNIX, SOCK_SEQPACKET, 0);\n" " if (data_socket == -1) {\n" " perror(\"socket\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /*\n" " * For portability clear the whole structure, since some\n" " * implementations have additional (nonstandard) fields in\n" " * the structure.\n" " */\n" "\\&\n" " memset(&addr, 0, sizeof(addr));\n" "\\&\n" " /* Connect socket to socket address. */\n" "\\&\n" " addr.sun_family = AF_UNIX;\n" " strncpy(addr.sun_path, SOCKET_NAME, sizeof(addr.sun_path) - 1);\n" "\\&\n" " ret = connect(data_socket, (const struct sockaddr *) &addr,\n" " sizeof(addr));\n" " if (ret == -1) {\n" " fprintf(stderr, \"The server is down.\\en\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Send arguments. */\n" "\\&\n" " for (int i = 1; i E argc; ++i) {\n" " w = write(data_socket, argv[i], strlen(argv[i]) + 1);\n" " if (w == -1) {\n" " perror(\"write\");\n" " break;\n" " }\n" " }\n" "\\&\n" " /* Request result. */\n" "\\&\n" " strcpy(buffer, \"END\");\n" " w = write(data_socket, buffer, strlen(buffer) + 1);\n" " if (w == -1) {\n" " perror(\"write\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Receive result. */\n" "\\&\n" " r = read(data_socket, buffer, sizeof(buffer));\n" " if (r == -1) {\n" " perror(\"read\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Ensure buffer is 0-terminated. */\n" "\\&\n" " buffer[sizeof(buffer) - 1] = 0;\n" "\\&\n" " printf(\"Result = %s\\en\", buffer);\n" "\\&\n" " /* Close socket. */\n" "\\&\n" " close(data_socket);\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" #. type: TH #: opensuse-leap-15-6 #, no-wrap msgid "2023-03-21" msgstr "21 марта 2023 г." #. type: TH #: opensuse-leap-15-6 #, no-wrap msgid "Linux man-pages 6.04" msgstr "Linux man-pages 6.04" #. type: TH #: opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "Linux man-pages 6.7" msgid "Linux man-pages (unreleased)" msgstr "Linux man-pages 6.7"