diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 19:43:11 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 19:43:11 +0000 |
commit | fc22b3d6507c6745911b9dfcc68f1e665ae13dbc (patch) | |
tree | ce1e3bce06471410239a6f41282e328770aa404a /po/ru/man7/fanotify.7.po | |
parent | Initial commit. (diff) | |
download | manpages-l10n-fc22b3d6507c6745911b9dfcc68f1e665ae13dbc.tar.xz manpages-l10n-fc22b3d6507c6745911b9dfcc68f1e665ae13dbc.zip |
Adding upstream version 4.22.0.upstream/4.22.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'po/ru/man7/fanotify.7.po')
-rw-r--r-- | po/ru/man7/fanotify.7.po | 3783 |
1 files changed, 3783 insertions, 0 deletions
diff --git a/po/ru/man7/fanotify.7.po b/po/ru/man7/fanotify.7.po new file mode 100644 index 00000000..01df540d --- /dev/null +++ b/po/ru/man7/fanotify.7.po @@ -0,0 +1,3783 @@ +# Russian translation of manpages +# This file is distributed under the same license as the manpages-l10n package. +# Copyright © of this file: +# Azamat Hackimov <azamat.hackimov@gmail.com>, 2017. +# Dmitry Bolkhovskikh <d20052005@yandex.ru>, 2017. +# Yuri Kozlov <yuray@komyakino.ru>, 2011-2019. +# Иван Павлов <pavia00@gmail.com>, 2017. +msgid "" +msgstr "" +"Project-Id-Version: manpages-l10n\n" +"POT-Creation-Date: 2024-03-01 16:56+0100\n" +"PO-Revision-Date: 2019-09-27 19:31+0300\n" +"Last-Translator: Yuri Kozlov <yuray@komyakino.ru>\n" +"Language-Team: Russian <man-pages-ru-talks@lists.sourceforge.net>\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 "fanotify" +msgstr "" + +#. type: TH +#: archlinux fedora-40 fedora-rawhide mageia-cauldron +#, no-wrap +msgid "2023-10-31" +msgstr "31 октября 2023 г." + +#. type: TH +#: archlinux fedora-40 fedora-rawhide mageia-cauldron +#, no-wrap +msgid "Linux man-pages 6.06" +msgstr "Linux man-pages 6.06" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "NAME" +msgstr "ИМЯ" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "fanotify - monitoring filesystem events" +msgstr "fanotify - отслеживание событий в файловой системе" + +#. 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 +#, fuzzy +#| msgid "" +#| "The fanotify API provides notification and interception of filesystem " +#| "events. Use cases include virus scanning and hierarchical storage " +#| "management. Currently, only a limited set of events is supported. In " +#| "particular, there is no support for create, delete, and move events. " +#| "(See B<inotify>(7) for details of an API that does notify those events.)" +msgid "" +"The fanotify API provides notification and interception of filesystem " +"events. Use cases include virus scanning and hierarchical storage " +"management. In the original fanotify API, only a limited set of events was " +"supported. In particular, there was no support for create, delete, and move " +"events. The support for those events was added in Linux 5.1. (See " +"B<inotify>(7) for details of an API that did notify those events pre Linux " +"5.1.)" +msgstr "" +"Программный интерфейс fanotify уведомляет о событиях в файловой системе и " +"перехватывает их. Например, его можно использовать для сканирования файлов " +"на вирусы и управления иерархическим хранилищем. В настоящее время, " +"поддерживается только ограниченный набор событий. В частности, не " +"поддерживаются события создания, удаления и перемещения (о программном " +"интерфейсе для этих событий смотрите в B<inotify>(7))." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"Additional capabilities compared to the B<inotify>(7) API include the " +"ability to monitor all of the objects in a mounted filesystem, the ability " +"to make access permission decisions, and the possibility to read or modify " +"files before access by other applications." +msgstr "" +"Дополнительные возможности по сравнению с программным интерфейсом " +"B<inotify>(7): способность отслеживать все объекты в смонтированной файловой " +"системе, давать права на доступ и читать или изменять файлы перед тем как " +"доступ получат другие приложения." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The following system calls are used with this API: B<fanotify_init>(2), " +"B<fanotify_mark>(2), B<read>(2), B<write>(2), and B<close>(2)." +msgstr "" +"В программный интерфейс входят следующие системные вызовы: " +"B<fanotify_init>(2), B<fanotify_mark>(2), B<read>(2), B<write>(2) и " +"B<close>(2)." + +#. type: SS +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "fanotify_init(), fanotify_mark(), and notification groups" +msgstr "Вызовы fanotify_init(), fanotify_mark() и группы уведомлений" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The B<fanotify_init>(2) system call creates and initializes an fanotify " +"notification group and returns a file descriptor referring to it." +msgstr "" +"Системный вызов B<fanotify_init>(2) создаёт и инициализирует группу " +"уведомления fanotify и возвращает указывающий на неё файловый дескриптор." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, fuzzy +#| msgid "" +#| "An fanotify notification group is a kernel-internal object that holds a " +#| "list of files, directories, filesystems, and mount points for which " +#| "events shall be created." +msgid "" +"An fanotify notification group is a kernel-internal object that holds a list " +"of files, directories, filesystems, and mounts for which events shall be " +"created." +msgstr "" +"Группа уведомления fanotify — это внутренний объект ядра, в котором хранится " +"список файлов, каталогов, файловых систем и точек монтирования, для которых " +"должны создаваться события." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, fuzzy +#| msgid "" +#| "For each entry in an fanotify notification group, two bit masks exist: " +#| "the I<mark> mask and the I<ignore> mask. The mark mask defines file " +#| "activities for which an event shall be created. The ignore mask defines " +#| "activities for which no event shall be generated. Having these two types " +#| "of masks permits a filesystem, mount point, or directory to be marked for " +#| "receiving events, while at the same time ignoring events for specific " +#| "objects under a mount point or directory." +msgid "" +"For each entry in an fanotify notification group, two bit masks exist: the " +"I<mark> mask and the I<ignore> mask. The mark mask defines file activities " +"for which an event shall be created. The ignore mask defines activities for " +"which no event shall be generated. Having these two types of masks permits " +"a filesystem, mount, or directory to be marked for receiving events, while " +"at the same time ignoring events for specific objects under a mount or " +"directory." +msgstr "" +"У каждой записи в группе уведомления fanotify есть две битовые маски: " +"I<меток> и I<игнорирования>. В маске меток указывается для каких действий на " +"файлами должны создаваться события. В маске игнорирования указывается для " +"каких действий не должны создаваться события. Имея маски таких типов можно " +"пометить файловую систему, точку монтирования или каталог для получения " +"событий, и в тоже время игнорировать события для определённых объектов в " +"этой точке монтирования или каталоге." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, fuzzy +#| msgid "" +#| "The B<fanotify_mark>(2) system call adds a file, directory, filesystem " +#| "or mount point to a notification group and specifies which events shall " +#| "be reported (or ignored), or removes or modifies such an entry." +msgid "" +"The B<fanotify_mark>(2) system call adds a file, directory, filesystem, or " +"mount to a notification group and specifies which events shall be reported " +"(or ignored), or removes or modifies such an entry." +msgstr "" +"Системный вызов B<fanotify_mark>(2) добавляет файл, каталог, файловую " +"систему или точку монтирования в группу уведомления и задаёт какие события " +"должны отслеживаться (или игнорироваться), или удаляет или изменяет нужную " +"запись." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, fuzzy +#| msgid "" +#| "A possible usage of the ignore mask is for a file cache. Events of " +#| "interest for a file cache are modification of a file and closing of the " +#| "same. Hence, the cached directory or mount point is to be marked to " +#| "receive these events. After receiving the first event informing that a " +#| "file has been modified, the corresponding cache entry will be " +#| "invalidated. No further modification events for this file are of " +#| "interest until the file is closed. Hence, the modify event can be added " +#| "to the ignore mask. Upon receiving the close event, the modify event can " +#| "be removed from the ignore mask and the file cache entry can be updated." +msgid "" +"A possible usage of the ignore mask is for a file cache. Events of interest " +"for a file cache are modification of a file and closing of the same. Hence, " +"the cached directory or mount is to be marked to receive these events. " +"After receiving the first event informing that a file has been modified, the " +"corresponding cache entry will be invalidated. No further modification " +"events for this file are of interest until the file is closed. Hence, the " +"modify event can be added to the ignore mask. Upon receiving the close " +"event, the modify event can be removed from the ignore mask and the file " +"cache entry can be updated." +msgstr "" +"Возможное применение маски игнорирования — кэш файлов. Интересующие события " +"для файлового кэша — изменение файла и закрытие. Для этого добавляем " +"кэшируемый каталог или точку монтирования для приёма этих событий. После " +"получения первого события об изменении файла, соответствующая запись кэша " +"помечается как недействительная. Дальнейшие события об изменении файла нас " +"не интересуют, пока файл не будет закрыт. Для этого событие об изменении " +"можно добавить в маску игнорирования. При получении события о закрытии, " +"событие об изменении можно удалить из маски игнорирования и запись файлового " +"кэша можно обновить." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The entries in the fanotify notification groups refer to files and " +"directories via their inode number and to mounts via their mount ID. If " +"files or directories are renamed or moved within the same mount, the " +"respective entries survive. If files or directories are deleted or moved to " +"another mount or if filesystems or mounts are unmounted, the corresponding " +"entries are deleted." +msgstr "" +"Записи в группе уведомления fanotify ссылаются на файл и каталог по номеру " +"иноды (inode), а на точку монтирования — через ID монтирования. При " +"переименовании или перемещении файла или каталога внутри той же точки " +"монтирования соответствующая запись остаётся. Если файл или каталог " +"удаляется или перемещается в другую точку монтирования, или если файловая " +"система или точка монтирования размонтируется, то соответствующая запись " +"удаляется." + +#. type: SS +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "The event queue" +msgstr "Очередь событий" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"As events occur on the filesystem objects monitored by a notification group, " +"the fanotify system generates events that are collected in a queue. These " +"events can then be read (using B<read>(2) or similar) from the fanotify " +"file descriptor returned by B<fanotify_init>(2)." +msgstr "" +"Для возникающих событий с объектами файловой системы, которые отслеживаются " +"группой уведомления, система fanotify генерирует события и помещает их в " +"очередь. После этого события можно прочитать (с помощью B<read>(2) и " +"подобных) из файлового дескриптора fanotify, возвращённого " +"B<fanotify_init>(2)." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, fuzzy +#| msgid "" +#| "Two types of events are generated: I<notification> events and " +#| "I<permission> events. Notification events are merely informative and " +#| "require no action to be taken by the receiving application with the " +#| "exception being that the file descriptor provided within a generic event " +#| "must be closed. The closing of file descriptors for each event applies " +#| "only to applications that have initialized fanotify without using " +#| "B<FAN_REPORT_FID> (see below). Permission events are requests to the " +#| "receiving application to decide whether permission for a file access " +#| "shall be granted. For these events, the recipient must write a response " +#| "which decides whether access is granted or not." +msgid "" +"Two types of events are generated: I<notification> events and I<permission> " +"events. Notification events are merely informative and require no action to " +"be taken by the receiving application with one exception: if a valid file " +"descriptor is provided within a generic event, the file descriptor must be " +"closed. Permission events are requests to the receiving application to " +"decide whether permission for a file access shall be granted. For these " +"events, the recipient must write a response which decides whether access is " +"granted or not." +msgstr "" +"Генерируется два типа событий: события I<уведомления> и события I<доступа>. " +"Уведомляющие события просто информируют и не требуют действия от принявшего " +"приложения, за исключением того, что файловый дескриптор, передаваемый в " +"событии общего типа, должен быть закрыт. Закрытие файловых дескрипторов для " +"каждого события применяется только приложениями, которые инициализировали " +"fanotify без использования B<FAN_REPORT_FID> (смотрите ниже). События " +"доступа запрашивают получившее приложение о разрешении доступа к файлу. Для " +"этих событий получатель должен написать ответ, давать ли доступ или нет." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"An event is removed from the event queue of the fanotify group when it has " +"been read. Permission events that have been read are kept in an internal " +"list of the fanotify group until either a permission decision has been taken " +"by writing to the fanotify file descriptor or the fanotify file descriptor " +"is closed." +msgstr "" +"Событие удаляется из очереди событий группы fanotify после прочтения. " +"События доступа, которые были прочитаны, остаются во внутреннем списке " +"группы fanotify до тех пор, пока решение о доступе не будет записано в " +"файловый дескриптор fanotify, или файловый дескриптор fanotify не будет " +"закрыт." + +#. type: SS +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "Reading fanotify events" +msgstr "Чтение событий fanotify" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"Calling B<read>(2) for the file descriptor returned by B<fanotify_init>(2) " +"blocks (if the flag B<FAN_NONBLOCK> is not specified in the call to " +"B<fanotify_init>(2)) until either a file event occurs or the call is " +"interrupted by a signal (see B<signal>(7))." +msgstr "" +"Вызов B<read>(2) с файловым дескриптором, полученным от B<fanotify_init>(2), " +"блокирует выполнение (если не указан флаг B<FAN_NONBLOCK> в вызове " +"B<fanotify_init>(2)) до тех пор, пока не произойдёт файловое событие или " +"вызов не будет прерван сигналом (смотрите B<signal>(7))." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"After a successful B<read>(2), the read buffer contains one or more of the " +"following structures:" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "" +"struct fanotify_event_metadata {\n" +" __u32 event_len;\n" +" __u8 vers;\n" +" __u8 reserved;\n" +" __u16 metadata_len;\n" +" __aligned_u64 mask;\n" +" __s32 fd;\n" +" __s32 pid;\n" +"};\n" +msgstr "" +"struct fanotify_event_metadata {\n" +" __u32 event_len;\n" +" __u8 vers;\n" +" __u8 reserved;\n" +" __u16 metadata_len;\n" +" __aligned_u64 mask;\n" +" __s32 fd;\n" +" __s32 pid;\n" +"};\n" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"Information records are supplemental pieces of information that may be " +"provided alongside the generic I<fanotify_event_metadata> structure. The " +"I<flags> passed to B<fanotify_init>(2) have influence over the type of " +"information records that may be returned for an event. For example, if a " +"notification group is initialized with B<FAN_REPORT_FID> or " +"B<FAN_REPORT_DIR_FID>, then event listeners should also expect to receive a " +"I<fanotify_event_info_fid> structure alongside the " +"I<fanotify_event_metadata> structure, whereby file handles are used to " +"identify filesystem objects rather than file descriptors. Information " +"records may also be stacked, meaning that using the various B<FAN_REPORT_*> " +"flags in conjunction with one another is supported. In such cases, multiple " +"information records can be returned for an event alongside the generic " +"I<fanotify_event_metadata> structure. For example, if a notification group " +"is initialized with B<FAN_REPORT_TARGET_FID> and B<FAN_REPORT_PIDFD>, then " +"an event listener should expect to receive up to two " +"I<fanotify_event_info_fid> information records and one " +"I<fanotify_event_info_pidfd> information record alongside the generic " +"I<fanotify_event_metadata> structure. Importantly, fanotify provides no " +"guarantee around the ordering of information records when a notification " +"group is initialized with a stacked based configuration. Each information " +"record has a nested structure of type I<fanotify_event_info_header>. It is " +"imperative for event listeners to inspect the I<info_type> field of this " +"structure in order to determine the type of information record that had been " +"received for a given event." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, fuzzy +#| msgid "" +#| "In the case where B<FAN_REPORT_FID> is supplied as one of the flags to " +#| "B<fanotify_init>(2), you should also expect to receive the structure " +#| "detailed below following the generic I<fanotify_event_metadata> structure " +#| "within the read buffer:" +msgid "" +"In cases where an fanotify group identifies filesystem objects by file " +"handles, event listeners should also expect to receive one or more of the " +"below information record objects alongside the generic " +"I<fanotify_event_metadata> structure within the read buffer:" +msgstr "" +"Если в B<fanotify_init>(2) среди флагов указан и B<FAN_REPORT_FID>, то вы " +"также должны ожидать структуру после общей структуры " +"I<fanotify_event_metadata> в буфере чтения:" + +#. type: Plain text +#: archlinux fedora-40 fedora-rawhide mageia-cauldron +#, fuzzy, no-wrap +#| msgid "" +#| "struct fanotify_event_info_fid {\n" +#| " struct fanotify_event_info_header hdr;\n" +#| " __kernel_fsid_t fsid;\n" +#| " unsigned char file_handle[0];\n" +#| "};\n" +msgid "" +"struct fanotify_event_info_fid {\n" +" struct fanotify_event_info_header hdr;\n" +" __kernel_fsid_t fsid;\n" +" unsigned char handle[];\n" +"};\n" +msgstr "" +"struct fanotify_event_info_fid {\n" +" struct fanotify_event_info_header hdr;\n" +" __kernel_fsid_t fsid;\n" +" unsigned char file_handle[0];\n" +"};\n" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, fuzzy +#| msgid "" +#| "In the case where B<FAN_REPORT_FID> is supplied as one of the flags to " +#| "B<fanotify_init>(2), you should also expect to receive the structure " +#| "detailed below following the generic I<fanotify_event_metadata> structure " +#| "within the read buffer:" +msgid "" +"In cases where an fanotify group is initialized with B<FAN_REPORT_PIDFD>, " +"event listeners should expect to receive the below information record object " +"alongside the generic I<fanotify_event_metadata> structure within the read " +"buffer:" +msgstr "" +"Если в B<fanotify_init>(2) среди флагов указан и B<FAN_REPORT_FID>, то вы " +"также должны ожидать структуру после общей структуры " +"I<fanotify_event_metadata> в буфере чтения:" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "" +"struct fanotify_event_info_pidfd {\n" +" struct fanotify_event_info_header hdr;\n" +" __s32 pidfd;\n" +"};\n" +msgstr "" +"struct fanotify_event_info_pidfd {\n" +" struct fanotify_event_info_header hdr;\n" +" __s32 pidfd;\n" +"};\n" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"In case of a B<FAN_FS_ERROR> event, an additional information record " +"describing the error that occurred is returned alongside the generic " +"I<fanotify_event_metadata> structure within the read buffer. This structure " +"is defined as follows:" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "" +"struct fanotify_event_info_error {\n" +" struct fanotify_event_info_header hdr;\n" +" __s32 error;\n" +" __u32 error_count;\n" +"};\n" +msgstr "" +"struct fanotify_event_info_error {\n" +" struct fanotify_event_info_header hdr;\n" +" __s32 error;\n" +" __u32 error_count;\n" +"};\n" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"All information records contain a nested structure of type " +"I<fanotify_event_info_header>. This structure holds meta-information about " +"the information record that may have been returned alongside the generic " +"I<fanotify_event_metadata> structure. This structure is defined as follows:" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "" +"struct fanotify_event_info_header {\n" +"\t__u8 info_type;\n" +"\t__u8 pad;\n" +"\t__u16 len;\n" +"};\n" +msgstr "" +"struct fanotify_event_info_header {\n" +"\t__u8 info_type;\n" +"\t__u8 pad;\n" +"\t__u16 len;\n" +"};\n" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"For performance reasons, it is recommended to use a large buffer size (for " +"example, 4096 bytes), so that multiple events can be retrieved by a single " +"B<read>(2)." +msgstr "" +"Для увеличения производительности рекомендуется использовать буфер большого " +"размера (например, 4096 байт) для того, чтобы получить несколько событий за " +"один вызов B<read>(2)." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The return value of B<read>(2) is the number of bytes placed in the buffer, " +"or -1 in case of an error (but see BUGS)." +msgstr "" +"Возвращаемое B<read>(2) значение — количество байт помещённых в буфер, или " +"-1 в случае ошибки (но смотрите ДЕФЕКТЫ)." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "The fields of the I<fanotify_event_metadata> structure are as follows:" +msgstr "Поля структуры I<fanotify_event_metadata>:" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "I<event_len>" +msgstr "I<event_len>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, fuzzy +#| msgid "" +#| "This is the length of the data for the current event and the offset to " +#| "the next event in the buffer. Without B<FAN_REPORT_FID>, the value of " +#| "I<event_len> is always B<FAN_EVENT_METADATA_LEN>. With " +#| "B<FAN_REPORT_FID>, I<event_len> also includes the variable length file " +#| "identifier." +msgid "" +"This is the length of the data for the current event and the offset to the " +"next event in the buffer. Unless the group identifies filesystem objects by " +"file handles, the value of I<event_len> is always " +"B<FAN_EVENT_METADATA_LEN>. For a group that identifies filesystem objects " +"by file handles, I<event_len> also includes the variable length file " +"identifier records." +msgstr "" +"Длина данных текущего события и смещение на следующее событие в буфере. Без " +"B<FAN_REPORT_FID> значение I<event_len> всегда равно " +"B<FAN_EVENT_METADATA_LEN>. С B<FAN_REPORT_FID> значение I<event_len> также " +"включает идентификатор файла переменной длины." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "I<vers>" +msgstr "I<vers>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"This field holds a version number for the structure. It must be compared to " +"B<FANOTIFY_METADATA_VERSION> to verify that the structures returned at run " +"time match the structures defined at compile time. In case of a mismatch, " +"the application should abandon trying to use the fanotify file descriptor." +msgstr "" +"Номер версии структуры. Он должен сравниваться с " +"B<FANOTIFY_METADATA_VERSION> для проверки того, что структуры, возвращаемые " +"во время выполнения, соответствуют структурам, определённым во время " +"компиляция. В случае несоответствия приложение должно прекратить попытки " +"использовать файловый дескриптор fanotify." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "I<reserved>" +msgstr "I<reserved>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "This field is not used." +msgstr "Не используется." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "I<metadata_len>" +msgstr "I<metadata_len>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"This is the length of the structure. The field was introduced to facilitate " +"the implementation of optional headers per event type. No such optional " +"headers exist in the current implementation." +msgstr "" +"Длина структуры. Это поле было добавлено для облегчения реализации " +"необязательных заголовков разных типов событий. В текущей реализации такие " +"необязательные заголовки отсутствуют." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "I<mask>" +msgstr "I<mask>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "This is a bit mask describing the event (see below)." +msgstr "Битовая маска, описывающая событие (смотрите далее)." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "I<fd>" +msgstr "I<fd>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, fuzzy +#| msgid "" +#| "This is an open file descriptor for the object being accessed, or " +#| "B<FAN_NOFD> if a queue overflow occurred. If the fanotify file " +#| "descriptor has been initialized using B<FAN_REPORT_FID>, applications " +#| "should expect this value to be set to B<FAN_NOFD> for each event that is " +#| "received. The file descriptor can be used to access the contents of the " +#| "monitored file or directory. The reading application is responsible for " +#| "closing this file descriptor." +msgid "" +"This is an open file descriptor for the object being accessed, or " +"B<FAN_NOFD> if a queue overflow occurred. With an fanotify group that " +"identifies filesystem objects by file handles, applications should expect " +"this value to be set to B<FAN_NOFD> for each event that is received. The " +"file descriptor can be used to access the contents of the monitored file or " +"directory. The reading application is responsible for closing this file " +"descriptor." +msgstr "" +"Открытый файловый дескриптор объекта доступа или B<FAN_NOFD>, если возникло " +"переполнение очереди. Если файловый дескриптор fanotify инициализирован с " +"использованием B<FAN_REPORT_FID>,то приложения должны ожидать, что это " +"значение равно B<FAN_NOFD> у каждого полученного события. Файловый " +"дескриптор можно использовать для доступа к содержимому отслеживаемого файла " +"или каталога. Читающее приложение ответственно за закрытие этого файлового " +"дескриптора." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"When calling B<fanotify_init>(2), the caller may specify (via the " +"I<event_f_flags> argument) various file status flags that are to be set on " +"the open file description that corresponds to this file descriptor. In " +"addition, the (kernel-internal) B<FMODE_NONOTIFY> file status flag is set " +"on the open file description. This flag suppresses fanotify event " +"generation. Hence, when the receiver of the fanotify event accesses the " +"notified file or directory using this file descriptor, no additional events " +"will be created." +msgstr "" +"Когда вызывается B<fanotify_init>(2) вызывающий может указать (в аргументе " +"I<event_f_flags>) различные флаги состояния файла, которые будут установлены " +"на открытом файловом дескрипторе, соответствующем этому файловому " +"дескриптору. Также, на отрываемом файловом дескрипторе устанавливается " +"(внутри ядра) флаг состояния файла B<FMODE_NONOTIFY>. Этот флаг подавляет " +"генерацию событий fanotify. Таким образом, когда получатель события fanotify " +"обратится к отслеживаемому файлу или каталогу через этот файловый " +"дескриптор, дополнительных событий создано не будет." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "I<pid>" +msgstr "I<pid>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"If flag B<FAN_REPORT_TID> was set in B<fanotify_init>(2), this is the TID of " +"the thread that caused the event. Otherwise, this the PID of the process " +"that caused the event." +msgstr "" +"Если в B<fanotify_init>(2) установлен флаг B<FAN_REPORT_TID>, то это TID " +"нити, из-за которой возникло событие. В противном случае это PID процесса, " +"из-за которой возникло событие." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"A program listening to fanotify events can compare this PID to the PID " +"returned by B<getpid>(2), to determine whether the event is caused by the " +"listener itself, or is due to a file access by another process." +msgstr "" +"Программа, слушающая события fanotify, может сравнить этот PID с PID, " +"возвращаемым B<getpid>(2), для проверки, что событие не возникло из-за " +"самого слушающего, а из-за доступа к файлу другого процесса." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The bit mask in I<mask> indicates which events have occurred for a single " +"filesystem object. Multiple bits may be set in this mask, if more than one " +"event occurred for the monitored filesystem object. In particular, " +"consecutive events for the same filesystem object and originating from the " +"same process may be merged into a single event, with the exception that two " +"permission events are never merged into one queue entry." +msgstr "" +"В битовой маске I<mask> указывают события, произошедшие с одиночным объектом " +"файловой системы. В маске может быть установлено несколько бит, если было " +"более одного события с отслеживаемым объектом файловой системы. В частности, " +"возникшие друг за другом события с одним объектом файловой системы и " +"произошедшие из-за одного процесса могут быть объединены в одно событие, за " +"исключением того, что два события доступа никогда не объединяются в одном " +"элементе очереди." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "The bits that may appear in I<mask> are as follows:" +msgstr "Биты маски I<mask>:" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAN_ACCESS>" +msgstr "B<FAN_ACCESS>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "A file or a directory (but see BUGS) was accessed (read)." +msgstr "Доступ (на чтение) к файлу или каталогу (но смотрите ДЕФЕКТЫ)." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAN_OPEN>" +msgstr "B<FAN_OPEN>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "A file or a directory was opened." +msgstr "Файл или каталог открыт." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAN_OPEN_EXEC>" +msgstr "B<FAN_OPEN_EXEC>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"A file was opened with the intent to be executed. See NOTES in " +"B<fanotify_mark>(2) for additional details." +msgstr "Файл открыт для выполнения. Смотрите ЗАМЕЧАНИЯ в B<fanotify_mark>(2)." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAN_ATTRIB>" +msgstr "B<FAN_ATTRIB>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "A file or directory metadata was changed." +msgstr "Метаданные файла или каталога изменены." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAN_CREATE>" +msgstr "B<FAN_CREATE>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "A child file or directory was created in a watched parent." +msgstr "Создан дочерний файл или каталог в отслеживаемом родителе." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAN_DELETE>" +msgstr "B<FAN_DELETE>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "A child file or directory was deleted in a watched parent." +msgstr "Удалён дочерний файл или каталог в отслеживаемом родителе." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAN_DELETE_SELF>" +msgstr "B<FAN_DELETE_SELF>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "A watched file or directory was deleted." +msgstr "Отслеживаемый файл или каталог был удалён." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAN_FS_ERROR>" +msgstr "B<FAN_FS_ERROR>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, fuzzy +#| msgid "A watched file or directory was deleted." +msgid "A filesystem error was detected." +msgstr "Отслеживаемый файл или каталог был удалён." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAN_RENAME>" +msgstr "B<FAN_RENAME>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, fuzzy +#| msgid "A file or directory has been moved from a watched parent directory." +msgid "" +"A file or directory has been moved to or from a watched parent directory." +msgstr "" +"Дочерний файл или каталог был перемещён из отслеживаемого родительского " +"каталога." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAN_MOVED_FROM>" +msgstr "B<FAN_MOVED_FROM>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "A file or directory has been moved from a watched parent directory." +msgstr "" +"Дочерний файл или каталог был перемещён из отслеживаемого родительского " +"каталога." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAN_MOVED_TO>" +msgstr "B<FAN_MOVED_TO>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "A file or directory has been moved to a watched parent directory." +msgstr "" +"Дочерний файл или каталог был помещён в отслеживаемый родительский каталог." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAN_MOVE_SELF>" +msgstr "B<FAN_MOVE_SELF>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "A watched file or directory was moved." +msgstr "Отслеживаемый файл или каталог был перемещён." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAN_MODIFY>" +msgstr "B<FAN_MODIFY>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "A file was modified." +msgstr "Файл изменён." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAN_CLOSE_WRITE>" +msgstr "B<FAN_CLOSE_WRITE>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"A file that was opened for writing (B<O_WRONLY> or B<O_RDWR>) was closed." +msgstr "Файл, открытый на запись (B<O_WRONLY> или B<O_RDWR>), закрыт." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAN_CLOSE_NOWRITE>" +msgstr "B<FAN_CLOSE_NOWRITE>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"A file or directory that was opened read-only (B<O_RDONLY>) was closed." +msgstr "Файл или каталог, открытый только для чтения (B<O_RDONLY>), закрыт." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAN_Q_OVERFLOW>" +msgstr "B<FAN_Q_OVERFLOW>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, fuzzy +#| msgid "" +#| "The event queue exceeded the limit of 16384 entries. This limit can be " +#| "overridden by specifying the B<FAN_UNLIMITED_QUEUE> flag when calling " +#| "B<fanotify_init>(2)." +msgid "" +"The event queue exceeded the limit on number of events. This limit can be " +"overridden by specifying the B<FAN_UNLIMITED_QUEUE> flag when calling " +"B<fanotify_init>(2)." +msgstr "" +"Очередь событий превысила ограничение в 16384 записи. Это ограничение можно " +"изменить, указав флаг B<FAN_UNLIMITED_QUEUE> при вызове B<fanotify_init>(2)." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAN_ACCESS_PERM>" +msgstr "B<FAN_ACCESS_PERM>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"An application wants to read a file or directory, for example using " +"B<read>(2) or B<readdir>(2). The reader must write a response (as " +"described below) that determines whether the permission to access the " +"filesystem object shall be granted." +msgstr "" +"Приложение хочет прочитать файл или каталог, например, с помощью B<read>(2) " +"или B<readdir>(2). Читатель события должен написать ответ (описано далее) о " +"разрешении доступа к объекту файловой системы." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAN_OPEN_PERM>" +msgstr "B<FAN_OPEN_PERM>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"An application wants to open a file or directory. The reader must write a " +"response that determines whether the permission to open the filesystem " +"object shall be granted." +msgstr "" +"Приложение хочет открыть файл или каталог. Читатель события должен написать " +"ответ о разрешении открытия объекта файловой системы." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAN_OPEN_EXEC_PERM>" +msgstr "B<FAN_OPEN_EXEC_PERM>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"An application wants to open a file for execution. The reader must write a " +"response that determines whether the permission to open the filesystem " +"object for execution shall be granted. See NOTES in B<fanotify_mark>(2) " +"for additional details." +msgstr "" +"Приложение хочет открыть файл для выполнения. Читатель должен написать ответ " +"о разрешении открытия объекта файловой системы для выполнения. Смотрите " +"ЗАМЕЧАНИЯ в B<fanotify_mark>(2)." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "To check for any close event, the following bit mask may be used:" +msgstr "" +"Для проверки любого события закрытия может использоваться следующая битовая " +"маска:" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAN_CLOSE>" +msgstr "B<FAN_CLOSE>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "A file was closed. This is a synonym for:" +msgstr "Файл закрыт. Это синоним:" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE\n" +msgstr "FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE\n" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "To check for any move event, the following bit mask may be used:" +msgstr "" +"Для проверки любого события перемещения может использоваться следующая " +"битовая маска:" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAN_MOVE>" +msgstr "B<FAN_MOVE>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "A file or directory was moved. This is a synonym for:" +msgstr "Файл или каталог был перемещён. Это синоним для:" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "FAN_MOVED_FROM | FAN_MOVED_TO\n" +msgstr "FAN_MOVED_FROM | FAN_MOVED_TO\n" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The following bits may appear in I<mask> only in conjunction with other " +"event type bits:" +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAN_ONDIR>" +msgstr "B<FAN_ONDIR>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The events described in the I<mask> have occurred on a directory object. " +"Reporting events on directories requires setting this flag in the mark " +"mask. See B<fanotify_mark>(2) for additional details. The B<FAN_ONDIR> " +"flag is reported in an event mask only if the fanotify group identifies " +"filesystem objects by file handles." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"Information records that are supplied alongside the generic " +"I<fanotify_event_metadata> structure will always contain a nested structure " +"of type I<fanotify_event_info_header>. The fields of the " +"I<fanotify_event_info_header> are as follows:" +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "I<info_type>" +msgstr "I<info_type>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"A unique integer value representing the type of information record object " +"received for an event. The value of this field can be set to one of the " +"following: B<FAN_EVENT_INFO_TYPE_FID>, B<FAN_EVENT_INFO_TYPE_DFID>, " +"B<FAN_EVENT_INFO_TYPE_DFID_NAME>, or B<FAN_EVENT_INFO_TYPE_PIDFD>. The " +"value set for this field is dependent on the flags that have been supplied " +"to B<fanotify_init>(2). Refer to the field details of each information " +"record object type below to understand the different cases in which the " +"I<info_type> values can be set." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "I<pad>" +msgstr "I<pad>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"This field is currently not used by any information record object type and " +"therefore is set to zero." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "I<len>" +msgstr "I<len>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The value of I<len> is set to the size of the information record object, " +"including the I<fanotify_event_info_header>. The total size of all " +"additional information records is not expected to be larger than " +"(I<event_len> - I<metadata_len>)." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "The fields of the I<fanotify_event_info_fid> structure are as follows:" +msgstr "Поля структуры I<fanotify_event_info_fid>:" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "I<hdr>" +msgstr "I<hdr>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"This is a structure of type I<fanotify_event_info_header>. For example, " +"when an fanotify file descriptor is created using B<FAN_REPORT_FID>, a " +"single information record is expected to be attached to the event with " +"I<info_type> field value of B<FAN_EVENT_INFO_TYPE_FID>. When an fanotify " +"file descriptor is created using the combination of B<FAN_REPORT_FID> and " +"B<FAN_REPORT_DIR_FID>, there may be two information records attached to the " +"event: one with I<info_type> field value of B<FAN_EVENT_INFO_TYPE_DFID>, " +"identifying a parent directory object, and one with I<info_type> field value " +"of B<FAN_EVENT_INFO_TYPE_FID>, identifying a child object. Note that for " +"the directory entry modification events B<FAN_CREATE>, B<FAN_DELETE>, " +"B<FAN_MOVE>, and B<FAN_RENAME>, an information record identifying the " +"created/deleted/moved child object is reported only if an fanotify group was " +"initialized with the flag B<FAN_REPORT_TARGET_FID>." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "I<fsid>" +msgstr "I<fsid>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"This is a unique identifier of the filesystem containing the object " +"associated with the event. It is a structure of type I<__kernel_fsid_t> and " +"contains the same value as I<f_fsid> when calling B<statfs>(2)." +msgstr "" +"Уникальный идентификатор файловой системы, содержащей объект, связанный с " +"событием. Это структура имеет тип I<__kernel_fsid_t> и содержит те же " +"значения что и I<f_fsid> при вызове B<statfs>(2)." + +#. type: TP +#: archlinux fedora-40 fedora-rawhide mageia-cauldron +#, fuzzy, no-wrap +#| msgid "I<file_handle>" +msgid "I<handle>" +msgstr "I<file_handle>" + +#. type: Plain text +#: archlinux fedora-40 fedora-rawhide mageia-cauldron +msgid "" +"This field contains a variable-length structure of type I<struct " +"file_handle>. It is an opaque handle that corresponds to a specified object " +"on a filesystem as returned by B<name_to_handle_at>(2). It can be used to " +"uniquely identify a file on a filesystem and can be passed as an argument to " +"B<open_by_handle_at>(2). If the value of I<info_type> field is " +"B<FAN_EVENT_INFO_TYPE_DFID_NAME>, the file handle is followed by a null " +"terminated string that identifies the created/deleted/moved directory entry " +"name. For other events such as B<FAN_OPEN>, B<FAN_ATTRIB>, " +"B<FAN_DELETE_SELF>, and B<FAN_MOVE_SELF>, if the value of I<info_type> field " +"is B<FAN_EVENT_INFO_TYPE_FID>, the I<handle> identifies the object " +"correlated to the event. If the value of I<info_type> field is " +"B<FAN_EVENT_INFO_TYPE_DFID>, the I<handle> identifies the directory object " +"correlated to the event or the parent directory of a non-directory object " +"correlated to the event. If the value of I<info_type> field is " +"B<FAN_EVENT_INFO_TYPE_DFID_NAME>, the I<handle> identifies the same " +"directory object that would be reported with B<FAN_EVENT_INFO_TYPE_DFID> and " +"the file handle is followed by a null terminated string that identifies the " +"name of a directory entry in that directory, or '.' to identify the " +"directory object itself." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The fields of the I<fanotify_event_info_pidfd> structure are as follows:" +msgstr "Поля структуры I<fanotify_event_info_pidfd>:" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"This is a structure of type I<fanotify_event_info_header>. When an fanotify " +"group is initialized using B<FAN_REPORT_PIDFD>, the I<info_type> field value " +"of the I<fanotify_event_info_header> is set to B<FAN_EVENT_INFO_TYPE_PIDFD>." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "I<pidfd>" +msgstr "I<pidfd>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"This is a process file descriptor that refers to the process responsible for " +"generating the event. The returned process file descriptor is no different " +"from one which could be obtained manually if B<pidfd_open>(2) were to be " +"called on I<fanotify_event_metadata.pid>. In the instance that an error is " +"encountered during pidfd creation, one of two possible error types " +"represented by a negative integer value may be returned in this I<pidfd> " +"field. In cases where the process responsible for generating the event has " +"terminated prior to the event listener being able to read events from the " +"notification queue, B<FAN_NOPIDFD> is returned. The pidfd creation for an " +"event is only performed at the time the events are read from the " +"notification queue. All other possible pidfd creation failures are " +"represented by B<FAN_EPIDFD>. Once the event listener has dealt with an " +"event and the pidfd is no longer required, the pidfd should be closed via " +"B<close>(2)." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The fields of the I<fanotify_event_info_error> structure are as follows:" +msgstr "Поля структуры I<fanotify_event_info_error>:" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"This is a structure of type I<fanotify_event_info_header>. The I<info_type> " +"field is set to B<FAN_EVENT_INFO_TYPE_ERROR>." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "I<error>" +msgstr "I<error>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "Identifies the type of error that occurred." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "I<error_count>" +msgstr "I<error_count>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"This is a counter of the number of errors suppressed since the last error " +"was read." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The following macros are provided to iterate over a buffer containing " +"fanotify event metadata returned by a B<read>(2) from an fanotify file " +"descriptor:" +msgstr "" +"Следующие макросы позволяют обходить буфер с метаданными событий fanotify, " +"возвращаемый B<read>(2) из файлового дескриптора fanotify:" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAN_EVENT_OK(meta, len)>" +msgstr "B<FAN_EVENT_OK(meta, len)>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"This macro checks the remaining length I<len> of the buffer I<meta> against " +"the length of the metadata structure and the I<event_len> field of the first " +"metadata structure in the buffer." +msgstr "" +"Этот макрос сверяет оставшуюся длину I<len> буфера I<meta> с длиной " +"структуры метаданных и полем I<event_len> из первой структуры метаданных в " +"буфере." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAN_EVENT_NEXT(meta, len)>" +msgstr "B<FAN_EVENT_NEXT(meta, len)>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"This macro uses the length indicated in the I<event_len> field of the " +"metadata structure pointed to by I<meta> to calculate the address of the " +"next metadata structure that follows I<meta>. I<len> is the number of bytes " +"of metadata that currently remain in the buffer. The macro returns a " +"pointer to the next metadata structure that follows I<meta>, and reduces " +"I<len> by the number of bytes in the metadata structure that has been " +"skipped over (i.e., it subtracts I<meta-E<gt>event_len> from I<len>)." +msgstr "" +"Этот макрос использует длину из поля I<event_len> структуры метаданных, на " +"которую указывает I<meta>, для вычисления адреса следующей структуры " +"метаданных, которая находится после I<meta>. В поле I<len> указано " +"количество байт метаданных, оставшихся в буфере. Макрос возвращает указатель " +"на следующую структуру метаданных после I<meta> и уменьшает I<len> на " +"количество байт в структуре метаданных, которая была пропущена (т. е., " +"вычитает I<meta-E<gt>event_len> из I<len>)." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "In addition, there is:" +msgstr "Дополнительно есть:" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAN_EVENT_METADATA_LEN>" +msgstr "B<FAN_EVENT_METADATA_LEN>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"This macro returns the size (in bytes) of the structure " +"I<fanotify_event_metadata>. This is the minimum size (and currently the " +"only size) of any event metadata." +msgstr "" +"Этот макрос возвращает размер (в байтах) структуры " +"I<fanotify_event_metadata>. Это минимальный размер (и, в настоящее время, " +"единственный) метаданных любого события." + +#. type: SS +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "Monitoring an fanotify file descriptor for events" +msgstr "Отслеживание событий через файловый дескриптор fanotify" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"When an fanotify event occurs, the fanotify file descriptor indicates as " +"readable when passed to B<epoll>(7), B<poll>(2), or B<select>(2)." +msgstr "" +"Когда возникает событие fanotify файловый дескриптор fanotify помечается как " +"доступный для чтения при его передаче в B<epoll>(7), B<poll>(2) или " +"B<select>(2)." + +#. type: SS +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "Dealing with permission events" +msgstr "Работа с событиями доступа" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"For permission events, the application must B<write>(2) a structure of the " +"following form to the fanotify file descriptor:" +msgstr "" +"Для событий доступа приложение должно записать (B<write>(2)) в файловый " +"дескриптор fanotify следующую структуру:" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "" +"struct fanotify_response {\n" +" __s32 fd;\n" +" __u32 response;\n" +"};\n" +msgstr "" +"struct fanotify_response {\n" +" __s32 fd;\n" +" __u32 response;\n" +"};\n" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "The fields of this structure are as follows:" +msgstr "Поля этой структуры имеют следующее назначение:" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"This is the file descriptor from the structure I<fanotify_event_metadata>." +msgstr "Файловый дескриптор из структуры I<fanotify_event_metadata>." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "I<response>" +msgstr "I<response>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"This field indicates whether or not the permission is to be granted. Its " +"value must be either B<FAN_ALLOW> to allow the file operation or B<FAN_DENY> " +"to deny the file operation." +msgstr "" +"В этом поле указывает о разрешении доступа или запрещении. Данное значение " +"должно быть равно B<FAN_ALLOW>, чтобы разрешить операцию с файлом, или " +"B<FAN_DENY> для запрета." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"If access is denied, the requesting application call will receive an " +"B<EPERM> error. Additionally, if the notification group has been created " +"with the B<FAN_ENABLE_AUDIT> flag, then the B<FAN_AUDIT> flag can be set in " +"the I<response> field. In that case, the audit subsystem will log " +"information about the access decision to the audit logs." +msgstr "" + +#. type: SS +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, fuzzy, no-wrap +#| msgid "fanotify - monitoring filesystem events" +msgid "Monitoring filesystems for errors" +msgstr "fanotify - отслеживание событий в файловой системе" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"A single B<FAN_FS_ERROR> event is stored per filesystem at once. Extra " +"error messages are suppressed and accounted for in the I<error_count> field " +"of the existing B<FAN_FS_ERROR> event record, but details about the errors " +"are lost." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"Errors reported by B<FAN_FS_ERROR> are generic I<errno> values, but not all " +"kinds of error types are reported by all filesystems." +msgstr "" + +#. type: Plain text +#: archlinux fedora-40 fedora-rawhide mageia-cauldron +msgid "" +"Errors not directly related to a file (i.e. super block corruption) are " +"reported with an invalid I<handle>. For these errors, the I<handle> will " +"have the field I<handle_type> set to B<FILEID_INVALID>, and the handle " +"buffer size set to B<0>." +msgstr "" + +#. type: SS +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "Closing the fanotify file descriptor" +msgstr "Закрытие файлового дескриптора fanotify" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"When all file descriptors referring to the fanotify notification group are " +"closed, the fanotify group is released and its resources are freed for reuse " +"by the kernel. Upon B<close>(2), outstanding permission events will be set " +"to allowed." +msgstr "" +"Когда все файловые дескрипторы, указывающие на группу уведомления fanotify, " +"закрыты, группа fanotify освобождается и её ресурсы становятся доступны ядру " +"для повторного использования. После B<close>(2) все оставшиеся " +"непросмотренные события доступа будут разрешены." + +#. type: SS +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "/proc interfaces" +msgstr "Интерфейс /proc" + +#. type: Plain text +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +#, fuzzy +#| msgid "" +#| "The file I</proc/[pid]/fdinfo/[fd]> contains information about fanotify " +#| "marks for file descriptor I<fd> of process I<pid>. See B<proc>(5) for " +#| "details." +msgid "" +"The file I</proc/>pidI</fdinfo/>fd contains information about fanotify marks " +"for file descriptor I<fd> of process I<pid>. See B<proc>(5) for details." +msgstr "" +"Файл I</proc/[pid]/fdinfo/[fd]> содержит информацию о метках fanotify для " +"файлового дескриптора I<fd> процесса I<pid> Подробности смотрите в " +"B<proc>(5)." + +#. commit 5b8fea65d197f408bb00b251c70d842826d6b70b +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"Since Linux 5.13, the following interfaces can be used to control the amount " +"of kernel resources consumed by fanotify:" +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "I</proc/sys/fs/fanotify/max_queued_events>" +msgstr "I</proc/sys/fs/fanotify/max_queued_events>" + +#. commit 5b8fea65d197f408bb00b251c70d842826d6b70b +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The value in this file is used when an application calls " +"B<fanotify_init>(2) to set an upper limit on the number of events that can " +"be queued to the corresponding fanotify group. Events in excess of this " +"limit are dropped, but an B<FAN_Q_OVERFLOW> event is always generated. " +"Prior to Linux kernel 5.13, the hardcoded limit was 16384 events." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "I</proc/sys/fs/fanotify/max_user_group>" +msgstr "I</proc/sys/fs/fanotify/max_user_group>" + +#. commit 5b8fea65d197f408bb00b251c70d842826d6b70b +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"This specifies an upper limit on the number of fanotify groups that can be " +"created per real user ID. Prior to Linux kernel 5.13, the hardcoded limit " +"was 128 groups per user." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "I</proc/sys/fs/fanotify/max_user_marks>" +msgstr "I</proc/sys/fs/fanotify/max_user_marks>" + +#. commit 5b8fea65d197f408bb00b251c70d842826d6b70b +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"This specifies an upper limit on the number of fanotify marks that can be " +"created per real user ID. Prior to Linux kernel 5.13, the hardcoded limit " +"was 8192 marks per group (not per user)." +msgstr "" + +#. 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: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"In addition to the usual errors for B<read>(2), the following errors can " +"occur when reading from the fanotify file descriptor:" +msgstr "" +"Кроме обычных ошибок B<read>(2) при чтении из файлового дескриптора fanotify " +"могут возникать следующие ошибки:" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<EINVAL>" +msgstr "B<EINVAL>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "The buffer is too small to hold the event." +msgstr "Буфер слишком мал для хранения события." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<EMFILE>" +msgstr "B<EMFILE>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The per-process limit on the number of open files has been reached. See the " +"description of B<RLIMIT_NOFILE> in B<getrlimit>(2)." +msgstr "" +"Достигнуто максимальное попроцессное количество открытых файлов. Смотрите " +"описание B<RLIMIT_NOFILE> в B<getrlimit>(2)." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<ENFILE>" +msgstr "B<ENFILE>" + +#. 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. " +"See I</proc/sys/fs/file-max> in B<proc>(5)." +msgstr "" +"Достигнут предел на общее количество открытых файлов в системе. Смотрите I</" +"proc/sys/fs/file-max> в B<proc>(5)." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<ETXTBSY>" +msgstr "B<ETXTBSY>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"This error is returned by B<read>(2) if B<O_RDWR> or B<O_WRONLY> was " +"specified in the I<event_f_flags> argument when calling B<fanotify_init>(2) " +"and an event occurred for a monitored file that is currently being executed." +msgstr "" +"Эта ошибка возвращается B<read>(2), если при вызове B<fanotify_init>(2) в " +"аргументе I<event_f_flags> был указан B<O_RDWR> или B<O_WRONLY> и произошло " +"событие с отслеживаемым файлом, который в данный момент выполняется." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"In addition to the usual errors for B<write>(2), the following errors can " +"occur when writing to the fanotify file descriptor:" +msgstr "" +"Кроме обычных ошибок B<write>(2) при записи в файловый дескриптор fanotify " +"могут возникать следующие ошибки:" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"Fanotify access permissions are not enabled in the kernel configuration or " +"the value of I<response> in the response structure is not valid." +msgstr "" +"Свойство для проверки прав доступа fanotify не включено в настройках ядра " +"или некорректное значение I<response> в структуре ответа." + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<ENOENT>" +msgstr "B<ENOENT>" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The file descriptor I<fd> in the response structure is not valid. This may " +"occur when a response for the permission event has already been written." +msgstr "" +"Некорректный файловый дескриптор I<fd> в структуре ответа. Это может " +"происходить, когда ответ на право доступа уже был записан." + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "STANDARDS" +msgstr "СТАНДАРТЫ" + +#. type: Plain text +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +msgid "Linux." +msgstr "Linux." + +#. type: SH +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "HISTORY" +msgstr "ИСТОРИЯ" + +#. type: Plain text +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +#, fuzzy +#| msgid "" +#| "The fanotify API was introduced in version 2.6.36 of the Linux kernel and " +#| "enabled in version 2.6.37. Fdinfo support was added in version 3.8." +msgid "" +"The fanotify API was introduced in Linux 2.6.36 and enabled in Linux " +"2.6.37. fdinfo support was added in Linux 3.8." +msgstr "" +"Программный интерфейс fanotify представлен в версии 2.6.36 ядра Linux и " +"включён в версии 2.6.37. Поддержка fdinfo была добавлена в версии 3.8." + +#. 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 "" +"The fanotify API is available only if the kernel was built with the " +"B<CONFIG_FANOTIFY> configuration option enabled. In addition, fanotify " +"permission handling is available only if the " +"B<CONFIG_FANOTIFY_ACCESS_PERMISSIONS> configuration option is enabled." +msgstr "" +"Программный интерфейс fanotify доступен только, если ядро собрано с " +"включённым параметром настройки B<CONFIG_FANOTIFY>. Также, работа с доступом " +"в fanotify доступна только, если включён параметр настройки " +"B<CONFIG_FANOTIFY_ACCESS_PERMISSIONS>." + +#. type: SS +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "Limitations and caveats" +msgstr "Ограничения и подводные камни" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"Fanotify reports only events that a user-space program triggers through the " +"filesystem API. As a result, it does not catch remote events that occur on " +"network filesystems." +msgstr "" +"Fanotify сообщает только о событиях, которые возникли при использовании " +"пользовательскими программами программного интерфейса файловой системы. " +"Поэтому события об обращении к файлам в сетевых файловых системах не " +"отлавливаются." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The fanotify API does not report file accesses and modifications that may " +"occur because of B<mmap>(2), B<msync>(2), and B<munmap>(2)." +msgstr "" +"Программный интерфейс fanotify не сообщает о доступе и изменениях, которые " +"могут произойти из-за B<mmap>(2), B<msync>(2) и B<munmap>(2)." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"Events for directories are created only if the directory itself is opened, " +"read, and closed. Adding, removing, or changing children of a marked " +"directory does not create events for the monitored directory itself." +msgstr "" +"События для каталогов создаются только, если сам каталог открывается, " +"читается и закрывается. Добавление, удаление и изменение потомков " +"отслеживаемого каталога не приводит к возникновению событий." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, fuzzy +#| msgid "" +#| "Fanotify monitoring of directories is not recursive: to monitor " +#| "subdirectories under a directory, additional marks must be created. (But " +#| "note that the fanotify API provides no way of detecting when a " +#| "subdirectory has been created under a marked directory, which makes " +#| "recursive monitoring difficult.) Monitoring mounts offers the capability " +#| "to monitor a whole directory tree. Monitoring filesystems offers the " +#| "capability to monitor changes made from any mount of a filesystem " +#| "instance." +msgid "" +"Fanotify monitoring of directories is not recursive: to monitor " +"subdirectories under a directory, additional marks must be created. The " +"B<FAN_CREATE> event can be used for detecting when a subdirectory has been " +"created under a marked directory. An additional mark must then be set on " +"the newly created subdirectory. This approach is racy, because it can lose " +"events that occurred inside the newly created subdirectory, before a mark is " +"added on that subdirectory. Monitoring mounts offers the capability to " +"monitor a whole directory tree in a race-free manner. Monitoring " +"filesystems offers the capability to monitor changes made from any mount of " +"a filesystem instance in a race-free manner." +msgstr "" +"Fanotify не следит за каталогами рекурсивно: чтобы следить за подкаталогами " +"каталога, нужно их явно пометить (и, заметим, что программный интерфейс " +"fanotify не позволяет отслеживать создание подкаталога, что затрудняет " +"рекурсивное слежение). Отслеживание точек монтирования позволяет следить за " +"всем деревом каталогов. Отслеживание файловых систем позволяет следить за " +"изменениями, сделанными в любом смонтированном экземпляре файловой системы." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "The event queue can overflow. In this case, events are lost." +msgstr "Очередь событий может переполниться. В этом случае события теряются." + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "BUGS" +msgstr "ДЕФЕКТЫ" + +#. commit 820c12d5d6c0890bc93dd63893924a13041fdc35 +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"Before Linux 3.19, B<fallocate>(2) did not generate fanotify events. Since " +"Linux 3.19, calls to B<fallocate>(2) generate B<FAN_MODIFY> events." +msgstr "" +"До Linux 3.19, B<fallocate>(2) не генерировал событий fanotify. Начиная с " +"Linux 3.19, вызовы B<fallocate>(2) генерируют событие B<FAN_MODIFY>." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "As of Linux 3.17, the following bugs exist:" +msgstr "В Linux 3.17 существуют следующие дефекты:" + +#. 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 "" +"On Linux, a filesystem object may be accessible through multiple paths, for " +"example, a part of a filesystem may be remounted using the I<--bind> option " +"of B<mount>(8). A listener that marked a mount will be notified only of " +"events that were triggered for a filesystem object using the same mount. " +"Any other event will pass unnoticed." +msgstr "" +"В Linux объект файловой системы может быть доступен через несколько путей, " +"например, часть файловой системы может быть перемонтирована B<mount>(8) с " +"использованием параметра I<--bind>. Ожидающий слушатель получит уведомления " +"об объекте файловой системы только из запрошенной точки монтирования. О " +"событиях из других точек уведомлений не поступит." + +#. FIXME . A patch was proposed. +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"When an event is generated, no check is made to see whether the user ID of " +"the receiving process has authorization to read or write the file before " +"passing a file descriptor for that file. This poses a security risk, when " +"the B<CAP_SYS_ADMIN> capability is set for programs executed by unprivileged " +"users." +msgstr "" +"При генерации события не делается проверка, что пользовательскому ID " +"получающего процесса разрешено читать или писать в файл перед передачей " +"файлового дескриптора на этот файл. Это представляет некоторый риск " +"безопасности, когда у программ, выполняющихся непривилегированными " +"пользователями, есть мандат B<CAP_SYS_ADMIN>." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"If a call to B<read>(2) processes multiple events from the fanotify queue " +"and an error occurs, the return value will be the total length of the events " +"successfully copied to the user-space buffer before the error occurred. The " +"return value will not be -1, and I<errno> will not be set. Thus, the " +"reading application has no way to detect the error." +msgstr "" +"Если вызов B<read>(2) получает несколько событий из очереди fanotify и " +"возникает ошибка, будет возвращена полная длина событий, которые были " +"успешно скопированы в буфер пользовательского пространства до ошибки. " +"Возвращаемое значение не будет равно -1, и в I<errno> не записывается код " +"ошибки. То есть читающее приложение не может обнаружить ошибку." + +#. 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 two example programs below demonstrate the usage of the fanotify API." +msgstr "" +"Далее показано два примера программы, в которых " +"продемонстрированоиспользование программного интерфейса fanotify." + +#. type: SS +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "Example program: fanotify_example.c" +msgstr "Программа-пример: fanotify_example.c" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, fuzzy +#| msgid "" +#| "The first program is an example of fanotify being used with its event " +#| "object information passed in the form of a file descriptor. The program " +#| "marks the mount point passed as a command-line argument and waits for " +#| "events of type B<FAN_OPEN_PERM> and B<FAN_CLOSE_WRITE>. When a " +#| "permission event occurs, a B<FAN_ALLOW> response is given." +msgid "" +"The first program is an example of fanotify being used with its event object " +"information passed in the form of a file descriptor. The program marks the " +"mount passed as a command-line argument and waits for events of type " +"B<FAN_OPEN_PERM> and B<FAN_CLOSE_WRITE>. When a permission event occurs, a " +"B<FAN_ALLOW> response is given." +msgstr "" +"В первой программе показано как использовать fanotify с информацией об " +"событийном объекте, передаваемом в виде файлового дескриптора. Программа " +"помечает точку монтирования, переданную в аргументе командной строки, и ждёт " +"событий с типом B<FAN_OPEN_PERM> и B<FAN_CLOSE_WRITE>. При возникновении " +"событий доступа выдаёт ответ B<FAN_ALLOW>." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The following shell session shows an example of running this program. This " +"session involved editing the file I</home/user/temp/notes>. Before the file " +"was opened, a B<FAN_OPEN_PERM> event occurred. After the file was closed, a " +"B<FAN_CLOSE_WRITE> event occurred. Execution of the program ends when the " +"user presses the ENTER key." +msgstr "" +"В сеансе оболочки далее показан пример запуска программы. В сеансе " +"выполняется редактирование файла I</home/user/temp/notes>. Перед открытием " +"файла возникает событие B<FAN_OPEN_PERM>. После закрытия файла возникает " +"событие B<FAN_CLOSE_WRITE>. Выполнение программы заканчивается после нажатия " +"пользователем клавиши ENTER." + +#. type: Plain text +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-tumbleweed +#, fuzzy, no-wrap +#| msgid "" +#| "# B<./fanotify_example /home>\n" +#| "Press enter key to terminate.\n" +#| "Listening for events.\n" +#| "FAN_OPEN_PERM: File /home/user/temp/notes\n" +#| "FAN_CLOSE_WRITE: File /home/user/temp/notes\n" +msgid "" +"# B<./fanotify_example /home>\n" +"Press enter key to terminate.\n" +"Listening for events.\n" +"FAN_OPEN_PERM: File /home/user/temp/notes\n" +"FAN_CLOSE_WRITE: File /home/user/temp/notes\n" +"\\&\n" +"Listening for events stopped.\n" +msgstr "" +"# B<./fanotify_example /home>\n" +"Нажмите enter для завершения работы.\n" +"Ожидание событий.\n" +"FAN_OPEN_PERM: Файл /home/user/temp/notes\n" +"FAN_CLOSE_WRITE: Файл /home/user/temp/notes\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: fanotify_example.c" +msgstr "Исходный код программы: fanotify_example.c" + +#. type: Plain text +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-tumbleweed +#, no-wrap +msgid "" +"#define _GNU_SOURCE /* Needed to get O_LARGEFILE definition */\n" +"#include E<lt>errno.hE<gt>\n" +"#include E<lt>fcntl.hE<gt>\n" +"#include E<lt>limits.hE<gt>\n" +"#include E<lt>poll.hE<gt>\n" +"#include E<lt>stdio.hE<gt>\n" +"#include E<lt>stdlib.hE<gt>\n" +"#include E<lt>sys/fanotify.hE<gt>\n" +"#include E<lt>unistd.hE<gt>\n" +"\\&\n" +"/* Read all available fanotify events from the file descriptor \\[aq]fd\\[aq]. */\n" +"\\&\n" +"static void\n" +"handle_events(int fd)\n" +"{\n" +" const struct fanotify_event_metadata *metadata;\n" +" struct fanotify_event_metadata buf[200];\n" +" ssize_t len;\n" +" char path[PATH_MAX];\n" +" ssize_t path_len;\n" +" char procfd_path[PATH_MAX];\n" +" struct fanotify_response response;\n" +"\\&\n" +" /* Loop while events can be read from fanotify file descriptor. */\n" +"\\&\n" +" for (;;) {\n" +"\\&\n" +" /* Read some events. */\n" +"\\&\n" +" len = read(fd, buf, sizeof(buf));\n" +" if (len == -1 && errno != EAGAIN) {\n" +" perror(\"read\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" /* Check if end of available data reached. */\n" +"\\&\n" +" if (len E<lt>= 0)\n" +" break;\n" +"\\&\n" +" /* Point to the first event in the buffer. */\n" +"\\&\n" +" metadata = buf;\n" +"\\&\n" +" /* Loop over all events in the buffer. */\n" +"\\&\n" +" while (FAN_EVENT_OK(metadata, len)) {\n" +"\\&\n" +" /* Check that run-time and compile-time structures match. */\n" +"\\&\n" +" if (metadata-E<gt>vers != FANOTIFY_METADATA_VERSION) {\n" +" fprintf(stderr,\n" +" \"Mismatch of fanotify metadata version.\\en\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" /* metadata-E<gt>fd contains either FAN_NOFD, indicating a\n" +" queue overflow, or a file descriptor (a nonnegative\n" +" integer). Here, we simply ignore queue overflow. */\n" +"\\&\n" +" if (metadata-E<gt>fd E<gt>= 0) {\n" +"\\&\n" +" /* Handle open permission event. */\n" +"\\&\n" +" if (metadata-E<gt>mask & FAN_OPEN_PERM) {\n" +" printf(\"FAN_OPEN_PERM: \");\n" +"\\&\n" +" /* Allow file to be opened. */\n" +"\\&\n" +" response.fd = metadata-E<gt>fd;\n" +" response.response = FAN_ALLOW;\n" +" write(fd, &response, sizeof(response));\n" +" }\n" +"\\&\n" +" /* Handle closing of writable file event. */\n" +"\\&\n" +" if (metadata-E<gt>mask & FAN_CLOSE_WRITE)\n" +" printf(\"FAN_CLOSE_WRITE: \");\n" +"\\&\n" +" /* Retrieve and print pathname of the accessed file. */\n" +"\\&\n" +" snprintf(procfd_path, sizeof(procfd_path),\n" +" \"/proc/self/fd/%d\", metadata-E<gt>fd);\n" +" path_len = readlink(procfd_path, path,\n" +" sizeof(path) - 1);\n" +" if (path_len == -1) {\n" +" perror(\"readlink\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" path[path_len] = \\[aq]\\e0\\[aq];\n" +" printf(\"File %s\\en\", path);\n" +"\\&\n" +" /* Close the file descriptor of the event. */\n" +"\\&\n" +" close(metadata-E<gt>fd);\n" +" }\n" +"\\&\n" +" /* Advance to next event. */\n" +"\\&\n" +" metadata = FAN_EVENT_NEXT(metadata, len);\n" +" }\n" +" }\n" +"}\n" +"\\&\n" +"int\n" +"main(int argc, char *argv[])\n" +"{\n" +" char buf;\n" +" int fd, poll_num;\n" +" nfds_t nfds;\n" +" struct pollfd fds[2];\n" +"\\&\n" +" /* Check mount point is supplied. */\n" +"\\&\n" +" if (argc != 2) {\n" +" fprintf(stderr, \"Usage: %s MOUNT\\en\", argv[0]);\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" printf(\"Press enter key to terminate.\\en\");\n" +"\\&\n" +" /* Create the file descriptor for accessing the fanotify API. */\n" +"\\&\n" +" fd = fanotify_init(FAN_CLOEXEC | FAN_CLASS_CONTENT | FAN_NONBLOCK,\n" +" O_RDONLY | O_LARGEFILE);\n" +" if (fd == -1) {\n" +" perror(\"fanotify_init\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" /* Mark the mount for:\n" +" - permission events before opening files\n" +" - notification events after closing a write-enabled\n" +" file descriptor. */\n" +"\\&\n" +" if (fanotify_mark(fd, FAN_MARK_ADD | FAN_MARK_MOUNT,\n" +" FAN_OPEN_PERM | FAN_CLOSE_WRITE, AT_FDCWD,\n" +" argv[1]) == -1) {\n" +" perror(\"fanotify_mark\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" /* Prepare for polling. */\n" +"\\&\n" +" nfds = 2;\n" +"\\&\n" +" fds[0].fd = STDIN_FILENO; /* Console input */\n" +" fds[0].events = POLLIN;\n" +"\\&\n" +" fds[1].fd = fd; /* Fanotify input */\n" +" fds[1].events = POLLIN;\n" +"\\&\n" +" /* This is the loop to wait for incoming events. */\n" +"\\&\n" +" printf(\"Listening for events.\\en\");\n" +"\\&\n" +" while (1) {\n" +" poll_num = poll(fds, nfds, -1);\n" +" if (poll_num == -1) {\n" +" if (errno == EINTR) /* Interrupted by a signal */\n" +" continue; /* Restart poll() */\n" +"\\&\n" +" perror(\"poll\"); /* Unexpected error */\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" if (poll_num E<gt> 0) {\n" +" if (fds[0].revents & POLLIN) {\n" +"\\&\n" +" /* Console input is available: empty stdin and quit. */\n" +"\\&\n" +" while (read(STDIN_FILENO, &buf, 1) E<gt> 0 && buf != \\[aq]\\en\\[aq])\n" +" continue;\n" +" break;\n" +" }\n" +"\\&\n" +" if (fds[1].revents & POLLIN) {\n" +"\\&\n" +" /* Fanotify events are available. */\n" +"\\&\n" +" handle_events(fd);\n" +" }\n" +" }\n" +" }\n" +"\\&\n" +" printf(\"Listening for events stopped.\\en\");\n" +" exit(EXIT_SUCCESS);\n" +"}\n" +msgstr "" + +#. type: SS +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "Example program: fanotify_fid.c" +msgstr "Программа-пример: fanotify_fid.c" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, fuzzy +#| msgid "" +#| "The second program is an example of fanotify being used with " +#| "B<FAN_REPORT_FID> enabled. The program marks the filesystem object that " +#| "is passed as a command-line argument and waits until an event of type " +#| "B<FAN_CREATE> has occurred. The event mask indicates which type of " +#| "filesystem object\\(emeither a file or a directory\\(emwas created. Once " +#| "all events have been read from the buffer and processed accordingly, the " +#| "program simply terminates." +msgid "" +"The second program is an example of fanotify being used with a group that " +"identifies objects by file handles. The program marks the filesystem object " +"that is passed as a command-line argument and waits until an event of type " +"B<FAN_CREATE> has occurred. The event mask indicates which type of " +"filesystem object\\[em]either a file or a directory\\[em]was created. Once " +"all events have been read from the buffer and processed accordingly, the " +"program simply terminates." +msgstr "" +"Во второй программе показано как использовать fanotify с включённым " +"B<FAN_REPORT_FID>. Программа помечает объект файловой системы, переданный в " +"аргументе командной строки, и ждёт возникновения события с типом " +"B<FAN_CREATE>. В маске событий задаётся какой тип объекта файловой системы " +"ждать — файл или каталог. После того как все события из буфера будут " +"прочитаны и правильно обработаны программа просто завершает работу." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The following shell sessions show two different invocations of this program, " +"with different actions performed on a watched object." +msgstr "" +"В следующих сеансах показано два разных запуска программы с разными " +"выполняемыми действиями над наблюдаемым объектом." + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, fuzzy +#| msgid "" +#| "The first session shows a mark being placed on I</home/user>. This is " +#| "followed by the creation of a regular file, I</home/user/testfile.txt>. " +#| "This results in a B<FAN_CREATE> event being created and reported against " +#| "the file's parent watched directory object. Program execution ends once " +#| "all events captured within the buffer have been processed. Program " +#| "execution ends once all events captured within the buffer are processed." +msgid "" +"The first session shows a mark being placed on I</home/user>. This is " +"followed by the creation of a regular file, I</home/user/testfile.txt>. " +"This results in a B<FAN_CREATE> event being generated and reported against " +"the file's parent watched directory object and with the created file name. " +"Program execution ends once all events captured within the buffer have been " +"processed." +msgstr "" +"В первом сеансе ставится отметка на I</home/user>. После этого создаётся " +"обычный файл I</home/user/testfile.txt>. В результате возникает событие " +"B<FAN_CREATE>, в котором передаётсяобъект отслеживаемого родительского " +"каталога файла. Программа завершает выполнение после обработки всех " +"захваченных и помещённых в буфер событий." + +#. type: Plain text +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-tumbleweed +#, fuzzy, no-wrap +#| msgid "" +#| "# B<./fanotify_fid /home/user>\n" +#| "Listening for events.\n" +#| "FAN_CREATE (file created): Directory /home/user has been modified.\n" +#| "All events processed successfully. Program exiting.\n" +msgid "" +"# B<./fanotify_fid /home/user>\n" +"Listening for events.\n" +"FAN_CREATE (file created):\n" +" Directory /home/user has been modified.\n" +" Entry \\[aq]testfile.txt\\[aq] is not a subdirectory.\n" +"All events processed successfully. Program exiting.\n" +"\\&\n" +"$ B<touch /home/user/testfile.txt> # In another terminal\n" +msgstr "" +"# B<./fanotify_fid /home/user>\n" +"Ожидание событий.\n" +"FAN_CREATE (создан файл): Каталог /home/user изменён.\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 second session shows a mark being placed on I</home/user>. This is " +#| "followed by the creation of a directory, I</home/user/testdir>. This " +#| "specific action results in the program producing a B<FAN_CREATE> and " +#| "B<FAN_ONDIR> event." +msgid "" +"The second session shows a mark being placed on I</home/user>. This is " +"followed by the creation of a directory, I</home/user/testdir>. This " +"specific action results in a B<FAN_CREATE> event being generated and is " +"reported with the B<FAN_ONDIR> flag set and with the created directory name." +msgstr "" +"Во втором сеансе ставится отметка на I</home/user>. После этого создаётся " +"каталог I</home/user/testdir>. В результате такого специального действия в " +"программу передаются события B<FAN_CREATE> и B<FAN_ONDIR>." + +#. type: Plain text +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-tumbleweed +#, fuzzy, no-wrap +#| msgid "" +#| "# B<./fanotify_fid /home/user>\n" +#| "Listening for events.\n" +#| "FAN_CREATE | FAN_ONDIR (subdirectory created):\n" +#| " Directory /home/user has been modified.\n" +#| "All events processed successfully. Program exiting.\n" +msgid "" +"# B<./fanotify_fid /home/user>\n" +"Listening for events.\n" +"FAN_CREATE | FAN_ONDIR (subdirectory created):\n" +" Directory /home/user has been modified.\n" +" Entry \\[aq]testdir\\[aq] is a subdirectory.\n" +"All events processed successfully. Program exiting.\n" +"\\&\n" +"$ B<mkdir -p /home/user/testdir> # In another terminal\n" +msgstr "" +"# B<./fanotify_fid /home/user>\n" +"Ожидание событий.\n" +"FAN_CREATE | FAN_ONDIR (создан подкаталог):\n" +" Каталог /home/user изменён.\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: fanotify_fid.c" +msgstr "Исходный код программы: fanotify_fid.c" + +#. type: Plain text +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-tumbleweed +#, no-wrap +msgid "" +"#define _GNU_SOURCE\n" +"#include E<lt>errno.hE<gt>\n" +"#include E<lt>fcntl.hE<gt>\n" +"#include E<lt>limits.hE<gt>\n" +"#include E<lt>stdio.hE<gt>\n" +"#include E<lt>stdlib.hE<gt>\n" +"#include E<lt>sys/types.hE<gt>\n" +"#include E<lt>sys/stat.hE<gt>\n" +"#include E<lt>sys/fanotify.hE<gt>\n" +"#include E<lt>unistd.hE<gt>\n" +"\\&\n" +"#define BUF_SIZE 256\n" +"\\&\n" +"int\n" +"main(int argc, char *argv[])\n" +"{\n" +" int fd, ret, event_fd, mount_fd;\n" +" ssize_t len, path_len;\n" +" char path[PATH_MAX];\n" +" char procfd_path[PATH_MAX];\n" +" char events_buf[BUF_SIZE];\n" +" struct file_handle *file_handle;\n" +" struct fanotify_event_metadata *metadata;\n" +" struct fanotify_event_info_fid *fid;\n" +" const char *file_name;\n" +" struct stat sb;\n" +"\\&\n" +" if (argc != 2) {\n" +" fprintf(stderr, \"Invalid number of command line arguments.\\en\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" mount_fd = open(argv[1], O_DIRECTORY | O_RDONLY);\n" +" if (mount_fd == -1) {\n" +" perror(argv[1]);\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" /* Create an fanotify file descriptor with FAN_REPORT_DFID_NAME as\n" +" a flag so that program can receive fid events with directory\n" +" entry name. */\n" +"\\&\n" +" fd = fanotify_init(FAN_CLASS_NOTIF | FAN_REPORT_DFID_NAME, 0);\n" +" if (fd == -1) {\n" +" perror(\"fanotify_init\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" /* Place a mark on the filesystem object supplied in argv[1]. */\n" +"\\&\n" +" ret = fanotify_mark(fd, FAN_MARK_ADD | FAN_MARK_ONLYDIR,\n" +" FAN_CREATE | FAN_ONDIR,\n" +" AT_FDCWD, argv[1]);\n" +" if (ret == -1) {\n" +" perror(\"fanotify_mark\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" printf(\"Listening for events.\\en\");\n" +"\\&\n" +" /* Read events from the event queue into a buffer. */\n" +"\\&\n" +" len = read(fd, events_buf, sizeof(events_buf));\n" +" if (len == -1 && errno != EAGAIN) {\n" +" perror(\"read\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" /* Process all events within the buffer. */\n" +"\\&\n" +" for (metadata = (struct fanotify_event_metadata *) events_buf;\n" +" FAN_EVENT_OK(metadata, len);\n" +" metadata = FAN_EVENT_NEXT(metadata, len)) {\n" +" fid = (struct fanotify_event_info_fid *) (metadata + 1);\n" +" file_handle = (struct file_handle *) fid-E<gt>handle;\n" +"\\&\n" +" /* Ensure that the event info is of the correct type. */\n" +"\\&\n" +" if (fid-E<gt>hdr.info_type == FAN_EVENT_INFO_TYPE_FID ||\n" +" fid-E<gt>hdr.info_type == FAN_EVENT_INFO_TYPE_DFID) {\n" +" file_name = NULL;\n" +" } else if (fid-E<gt>hdr.info_type == FAN_EVENT_INFO_TYPE_DFID_NAME) {\n" +" file_name = file_handle-E<gt>f_handle +\n" +" file_handle-E<gt>handle_bytes;\n" +" } else {\n" +" fprintf(stderr, \"Received unexpected event info type.\\en\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" if (metadata-E<gt>mask == FAN_CREATE)\n" +" printf(\"FAN_CREATE (file created):\\en\");\n" +"\\&\n" +" if (metadata-E<gt>mask == (FAN_CREATE | FAN_ONDIR))\n" +" printf(\"FAN_CREATE | FAN_ONDIR (subdirectory created):\\en\");\n" +"\\&\n" +"\t/* metadata-E<gt>fd is set to FAN_NOFD when the group identifies\n" +"\t objects by file handles. To obtain a file descriptor for\n" +"\t the file object corresponding to an event you can use the\n" +"\t struct file_handle that\\[aq]s provided within the\n" +"\t fanotify_event_info_fid in conjunction with the\n" +"\t open_by_handle_at(2) system call. A check for ESTALE is\n" +"\t done to accommodate for the situation where the file handle\n" +"\t for the object was deleted prior to this system call. */\n" +"\\&\n" +" event_fd = open_by_handle_at(mount_fd, file_handle, O_RDONLY);\n" +" if (event_fd == -1) {\n" +" if (errno == ESTALE) {\n" +" printf(\"File handle is no longer valid. \"\n" +" \"File has been deleted\\en\");\n" +" continue;\n" +" } else {\n" +" perror(\"open_by_handle_at\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +" }\n" +"\\&\n" +" snprintf(procfd_path, sizeof(procfd_path), \"/proc/self/fd/%d\",\n" +" event_fd);\n" +"\\&\n" +" /* Retrieve and print the path of the modified dentry. */\n" +"\\&\n" +" path_len = readlink(procfd_path, path, sizeof(path) - 1);\n" +" if (path_len == -1) {\n" +" perror(\"readlink\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" path[path_len] = \\[aq]\\e0\\[aq];\n" +" printf(\"\\etDirectory \\[aq]%s\\[aq] has been modified.\\en\", path);\n" +"\\&\n" +" if (file_name) {\n" +" ret = fstatat(event_fd, file_name, &sb, 0);\n" +" if (ret == -1) {\n" +" if (errno != ENOENT) {\n" +" perror(\"fstatat\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +" printf(\"\\etEntry \\[aq]%s\\[aq] does not exist.\\en\", file_name);\n" +" } else if ((sb.st_mode & S_IFMT) == S_IFDIR) {\n" +" printf(\"\\etEntry \\[aq]%s\\[aq] is a subdirectory.\\en\", file_name);\n" +" } else {\n" +" printf(\"\\etEntry \\[aq]%s\\[aq] is not a subdirectory.\\en\",\n" +" file_name);\n" +" }\n" +" }\n" +"\\&\n" +" /* Close associated file descriptor for this event. */\n" +"\\&\n" +" close(event_fd);\n" +" }\n" +"\\&\n" +" printf(\"All events processed successfully. Program exiting.\\en\");\n" +" exit(EXIT_SUCCESS);\n" +"}\n" +msgstr "" + +#. 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<fanotify_init>(2), B<fanotify_mark>(2), B<inotify>(7)" +msgstr "B<fanotify_init>(2), B<fanotify_mark>(2), B<inotify>(7)" + +#. type: TH +#: debian-bookworm +#, no-wrap +msgid "2023-02-05" +msgstr "5 февраля 2023 г." + +#. type: TH +#: debian-bookworm +#, no-wrap +msgid "Linux man-pages 6.03" +msgstr "Linux man-pages 6.03" + +#. type: Plain text +#: debian-bookworm debian-unstable opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "" +"struct fanotify_event_info_fid {\n" +" struct fanotify_event_info_header hdr;\n" +" __kernel_fsid_t fsid;\n" +" unsigned char file_handle[0];\n" +"};\n" +msgstr "" +"struct fanotify_event_info_fid {\n" +" struct fanotify_event_info_header hdr;\n" +" __kernel_fsid_t fsid;\n" +" unsigned char file_handle[0];\n" +"};\n" + +#. type: TP +#: debian-bookworm debian-unstable opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "I<file_handle>" +msgstr "I<file_handle>" + +#. type: Plain text +#: debian-bookworm debian-unstable opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"This is a variable length structure of type struct file_handle. It is an " +"opaque handle that corresponds to a specified object on a filesystem as " +"returned by B<name_to_handle_at>(2). It can be used to uniquely identify a " +"file on a filesystem and can be passed as an argument to " +"B<open_by_handle_at>(2). If the value of I<info_type> field is " +"B<FAN_EVENT_INFO_TYPE_DFID_NAME>, the file handle is followed by a null " +"terminated string that identifies the created/deleted/moved directory entry " +"name. For other events such as B<FAN_OPEN>, B<FAN_ATTRIB>, " +"B<FAN_DELETE_SELF>, and B<FAN_MOVE_SELF>, if the value of I<info_type> field " +"is B<FAN_EVENT_INFO_TYPE_FID>, the I<file_handle> identifies the object " +"correlated to the event. If the value of I<info_type> field is " +"B<FAN_EVENT_INFO_TYPE_DFID>, the I<file_handle> identifies the directory " +"object correlated to the event or the parent directory of a non-directory " +"object correlated to the event. If the value of I<info_type> field is " +"B<FAN_EVENT_INFO_TYPE_DFID_NAME>, the I<file_handle> identifies the same " +"directory object that would be reported with B<FAN_EVENT_INFO_TYPE_DFID> and " +"the file handle is followed by a null terminated string that identifies the " +"name of a directory entry in that directory, or '.' to identify the " +"directory object itself." +msgstr "" + +#. type: Plain text +#: debian-bookworm debian-unstable opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"Errors not directly related to a file (i.e. super block corruption) are " +"reported with an invalid I<file_handle>. For these errors, the " +"I<file_handle> will have the field I<handle_type> set to B<FILEID_INVALID>, " +"and the handle buffer size set to B<0>." +msgstr "" + +#. type: Plain text +#: debian-bookworm +msgid "" +"The file I</proc/[pid]/fdinfo/[fd]> contains information about fanotify " +"marks for file descriptor I<fd> of process I<pid>. See B<proc>(5) for " +"details." +msgstr "" +"Файл I</proc/[pid]/fdinfo/[fd]> содержит информацию о метках fanotify для " +"файлового дескриптора I<fd> процесса I<pid> Подробности смотрите в " +"B<proc>(5)." + +#. type: SH +#: debian-bookworm +#, no-wrap +msgid "VERSIONS" +msgstr "ВЕРСИИ" + +#. type: Plain text +#: debian-bookworm +#, fuzzy +#| msgid "" +#| "The fanotify API was introduced in version 2.6.36 of the Linux kernel and " +#| "enabled in version 2.6.37. Fdinfo support was added in version 3.8." +msgid "" +"The fanotify API was introduced in Linux 2.6.36 and enabled in Linux " +"2.6.37. Fdinfo support was added in Linux 3.8." +msgstr "" +"Программный интерфейс fanotify представлен в версии 2.6.36 ядра Linux и " +"включён в версии 2.6.37. Поддержка fdinfo была добавлена в версии 3.8." + +#. type: Plain text +#: debian-bookworm +msgid "The fanotify API is Linux-specific." +msgstr "Программный интерфейс fanotify есть только в Linux." + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +"# B<./fanotify_example /home>\n" +"Press enter key to terminate.\n" +"Listening for events.\n" +"FAN_OPEN_PERM: File /home/user/temp/notes\n" +"FAN_CLOSE_WRITE: File /home/user/temp/notes\n" +msgstr "" +"# B<./fanotify_example /home>\n" +"Нажмите enter для завершения работы.\n" +"Ожидание событий.\n" +"FAN_OPEN_PERM: Файл /home/user/temp/notes\n" +"FAN_CLOSE_WRITE: Файл /home/user/temp/notes\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "Listening for events stopped.\n" +msgstr "Ожидание событий прекращено.\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +"#define _GNU_SOURCE /* Needed to get O_LARGEFILE definition */\n" +"#include E<lt>errno.hE<gt>\n" +"#include E<lt>fcntl.hE<gt>\n" +"#include E<lt>limits.hE<gt>\n" +"#include E<lt>poll.hE<gt>\n" +"#include E<lt>stdio.hE<gt>\n" +"#include E<lt>stdlib.hE<gt>\n" +"#include E<lt>sys/fanotify.hE<gt>\n" +"#include E<lt>unistd.hE<gt>\n" +msgstr "" +"#define _GNU_SOURCE /* для получения определения O_LARGEFILE */\n" +"#include E<lt>errno.hE<gt>\n" +"#include E<lt>fcntl.hE<gt>\n" +"#include E<lt>limits.hE<gt>\n" +"#include E<lt>poll.hE<gt>\n" +"#include E<lt>stdio.hE<gt>\n" +"#include E<lt>stdlib.hE<gt>\n" +"#include E<lt>sys/fanotify.hE<gt>\n" +"#include E<lt>unistd.hE<gt>\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, fuzzy, no-wrap +#| msgid "/* Read all available fanotify events from the file descriptor \\(aqfd\\(aq. */\n" +msgid "/* Read all available fanotify events from the file descriptor \\[aq]fd\\[aq]. */\n" +msgstr "/* Читаем все доступные события fanotify из файлового дескриптора «fd». */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +"static void\n" +"handle_events(int fd)\n" +"{\n" +" const struct fanotify_event_metadata *metadata;\n" +" struct fanotify_event_metadata buf[200];\n" +" ssize_t len;\n" +" char path[PATH_MAX];\n" +" ssize_t path_len;\n" +" char procfd_path[PATH_MAX];\n" +" struct fanotify_response response;\n" +msgstr "" +"static void\n" +"handle_events(int fd)\n" +"{\n" +" const struct fanotify_event_metadata *metadata;\n" +" struct fanotify_event_metadata buf[200];\n" +" ssize_t len;\n" +" char path[PATH_MAX];\n" +" ssize_t path_len;\n" +" char procfd_path[PATH_MAX];\n" +" struct fanotify_response response;\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " /* Loop while events can be read from fanotify file descriptor. */\n" +msgstr "" +" /* Проходим по всем событиям, которые можем прочитать\n" +" из файлового дескриптора fanotify. */\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 " /* Read some events. */\n" +msgstr " /* читаем несколько событий */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" len = read(fd, buf, sizeof(buf));\n" +" if (len == -1 && errno != EAGAIN) {\n" +" perror(\"read\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" +" len = read(fd, buf, sizeof(buf));\n" +" if (len == -1 && errno != EAGAIN) {\n" +" perror(\"read\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " /* Check if end of available data reached. */\n" +msgstr " /* Проверяем, достигнут ли конец доступных данных. */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" if (len E<lt>= 0)\n" +" break;\n" +msgstr "" +" if (len E<lt>= 0)\n" +" break;\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " /* Point to the first event in the buffer. */\n" +msgstr " /* Выбираем первое событие в буфере. */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " metadata = buf;\n" +msgstr " metadata = buf;\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " /* Loop over all events in the buffer. */\n" +msgstr " /* Проходим по всем событиям в буфере. */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " while (FAN_EVENT_OK(metadata, len)) {\n" +msgstr " while (FAN_EVENT_OK(metadata, len)) {\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " /* Check that run-time and compile-time structures match. */\n" +msgstr "" +" /* Проверяем, что структуры, использовавшиеся при сборке,\n" +" идентичны структурам при выполнении. */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" if (metadata-E<gt>vers != FANOTIFY_METADATA_VERSION) {\n" +" fprintf(stderr,\n" +" \"Mismatch of fanotify metadata version.\\en\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" +" if (metadata-E<gt>vers != FANOTIFY_METADATA_VERSION) {\n" +" fprintf(stderr,\n" +" \"Версия метаданных fanotify не совпадает.\\en\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" /* metadata-E<gt>fd contains either FAN_NOFD, indicating a\n" +" queue overflow, or a file descriptor (a nonnegative\n" +" integer). Here, we simply ignore queue overflow. */\n" +msgstr "" +" /* metadata-E<gt>fd содержит или FAN_NOFD, указывающее\n" +" на переполнение очереди, или файловый дескриптор\n" +" (неотрицательное целое). Здесь мы просто игнорируем\n" +" переполнение очереди. */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " if (metadata-E<gt>fd E<gt>= 0) {\n" +msgstr " if (metadata-E<gt>fd E<gt>= 0) {\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " /* Handle open permission event. */\n" +msgstr " /* Обрабатываем событие на право открытия. */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" if (metadata-E<gt>mask & FAN_OPEN_PERM) {\n" +" printf(\"FAN_OPEN_PERM: \");\n" +msgstr "" +" if (metadata-E<gt>mask & FAN_OPEN_PERM) {\n" +" printf(\"FAN_OPEN_PERM: \");\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " /* Allow file to be opened. */\n" +msgstr " /* Разрешаем открыть файл. */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" response.fd = metadata-E<gt>fd;\n" +" response.response = FAN_ALLOW;\n" +" write(fd, &response, sizeof(response));\n" +" }\n" +msgstr "" +" response.fd = metadata-E<gt>fd;\n" +" response.response = FAN_ALLOW;\n" +" write(fd, &response, sizeof(response));\n" +" }\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " /* Handle closing of writable file event. */\n" +msgstr " /* Обрабатываем событие закрытия записываемого файла. */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" if (metadata-E<gt>mask & FAN_CLOSE_WRITE)\n" +" printf(\"FAN_CLOSE_WRITE: \");\n" +msgstr "" +" if (metadata-E<gt>mask & FAN_CLOSE_WRITE)\n" +" printf(\"FAN_CLOSE_WRITE: \");\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " /* Retrieve and print pathname of the accessed file. */\n" +msgstr "" +" /* Получаем и выводим имя файла, к которому\n" +" отслеживается доступ. */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" snprintf(procfd_path, sizeof(procfd_path),\n" +" \"/proc/self/fd/%d\", metadata-E<gt>fd);\n" +" path_len = readlink(procfd_path, path,\n" +" sizeof(path) - 1);\n" +" if (path_len == -1) {\n" +" perror(\"readlink\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" +" snprintf(procfd_path, sizeof(procfd_path),\n" +" \"/proc/self/fd/%d\", metadata-E<gt>fd);\n" +" path_len = readlink(procfd_path, path,\n" +" sizeof(path) - 1);\n" +" if (path_len == -1) {\n" +" perror(\"readlink\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, fuzzy, no-wrap +#| msgid "" +#| " path[path_len] = \\(aq\\e0\\(aq;\n" +#| " printf(\"File %s\\en\", path);\n" +msgid "" +" path[path_len] = \\[aq]\\e0\\[aq];\n" +" printf(\"File %s\\en\", path);\n" +msgstr "" +" path[path_len] = \\(aq\\e0\\(aq;\n" +" printf(\"Файл %s\\en\", path);\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " /* Close the file descriptor of the event. */\n" +msgstr " /* Закрываем файловый дескриптор из события. */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" close(metadata-E<gt>fd);\n" +" }\n" +msgstr "" +" close(metadata-E<gt>fd);\n" +" }\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " /* Advance to next event. */\n" +msgstr " /* Переходим на следующее событие. */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" metadata = FAN_EVENT_NEXT(metadata, len);\n" +" }\n" +" }\n" +"}\n" +msgstr "" +" metadata = FAN_EVENT_NEXT(metadata, len);\n" +" }\n" +" }\n" +"}\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +"int\n" +"main(int argc, char *argv[])\n" +"{\n" +" char buf;\n" +" int fd, poll_num;\n" +" nfds_t nfds;\n" +" struct pollfd fds[2];\n" +msgstr "" +"int\n" +"main(int argc, char *argv[])\n" +"{\n" +" char buf;\n" +" int fd, poll_num;\n" +" nfds_t nfds;\n" +" struct pollfd fds[2];\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " /* Check mount point is supplied. */\n" +msgstr " /* Проверяем заданную точку монтирования. */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" if (argc != 2) {\n" +" fprintf(stderr, \"Usage: %s MOUNT\\en\", argv[0]);\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" +" if (argc != 2) {\n" +" fprintf(stderr, \"Использование: %s ТОЧКА_МОНТИРОВАНИЯ\\en\",\n" +" argv[0]);\n" +" exit(EXIT_FAILURE);\n" +" }\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " printf(\"Press enter key to terminate.\\en\");\n" +msgstr " printf(\"Нажмите enter для завершения работы.\\en\");\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " /* Create the file descriptor for accessing the fanotify API. */\n" +msgstr " /* Создаём файловый дескриптор для доступа к fanotify API. */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" fd = fanotify_init(FAN_CLOEXEC | FAN_CLASS_CONTENT | FAN_NONBLOCK,\n" +" O_RDONLY | O_LARGEFILE);\n" +" if (fd == -1) {\n" +" perror(\"fanotify_init\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" +" fd = fanotify_init(FAN_CLOEXEC | FAN_CLASS_CONTENT | FAN_NONBLOCK,\n" +" O_RDONLY | O_LARGEFILE);\n" +" if (fd == -1) {\n" +" perror(\"fanotify_init\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" /* Mark the mount for:\n" +" - permission events before opening files\n" +" - notification events after closing a write-enabled\n" +" file descriptor. */\n" +msgstr "" +" /* Помечаем точку монтирования для:\n" +" - событий доступа перед открытием файлов\n" +" - событий уведомления после закрытия файлового дескриптора\n" +" для файла открытого для записи. */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" if (fanotify_mark(fd, FAN_MARK_ADD | FAN_MARK_MOUNT,\n" +" FAN_OPEN_PERM | FAN_CLOSE_WRITE, AT_FDCWD,\n" +" argv[1]) == -1) {\n" +" perror(\"fanotify_mark\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" +" if (fanotify_mark(fd, FAN_MARK_ADD | FAN_MARK_MOUNT,\n" +" FAN_OPEN_PERM | FAN_CLOSE_WRITE, AT_FDCWD,\n" +" argv[1]) == -1) {\n" +" perror(\"fanotify_mark\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " /* Prepare for polling. */\n" +msgstr " /* Подготовка к опросу. */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " nfds = 2;\n" +msgstr " nfds = 2;\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, fuzzy, no-wrap +#| msgid "" +#| " fds[0].fd = STDIN_FILENO;\n" +#| " fds[0].events = POLLIN;\n" +msgid "" +" fds[0].fd = STDIN_FILENO; /* Console input */\n" +" fds[0].events = POLLIN;\n" +msgstr "" +" fds[0].fd = STDIN_FILENO;\n" +" fds[0].events = POLLIN;\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, fuzzy, no-wrap +#| msgid "" +#| " fds[1].fd = fd;\n" +#| " fds[1].events = POLLIN;\n" +msgid "" +" fds[1].fd = fd; /* Fanotify input */\n" +" fds[1].events = POLLIN;\n" +msgstr "" +" fds[1].fd = fd;\n" +" fds[1].events = POLLIN;\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " /* This is the loop to wait for incoming events. */\n" +msgstr " /* Цикл ожидания входящих событий. */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " printf(\"Listening for events.\\en\");\n" +msgstr " printf(\"Ожидание событий.\\en\");\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" while (1) {\n" +" poll_num = poll(fds, nfds, -1);\n" +" if (poll_num == -1) {\n" +" if (errno == EINTR) /* Interrupted by a signal */\n" +" continue; /* Restart poll() */\n" +msgstr "" +" while (1) {\n" +" poll_num = poll(fds, nfds, -1);\n" +" if (poll_num == -1) {\n" +" if (errno == EINTR) /* прервано сигналом */\n" +" continue; /* перезапуск poll() */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" perror(\"poll\"); /* Unexpected error */\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" +" perror(\"poll\"); /* неожиданная ошибка */\n" +" exit(EXIT_FAILURE);\n" +" }\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" if (poll_num E<gt> 0) {\n" +" if (fds[0].revents & POLLIN) {\n" +msgstr "" +" if (poll_num E<gt> 0) {\n" +" if (fds[0].revents & POLLIN) {\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " /* Console input is available: empty stdin and quit. */\n" +msgstr " /* Доступен ввод с консоли: опустошаем stdin и выходим. */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" while (read(STDIN_FILENO, &buf, 1) E<gt> 0 && buf != \\[aq]\\en\\[aq])\n" +" continue;\n" +" break;\n" +" }\n" +msgstr "" +" while (read(STDIN_FILENO, &buf, 1) E<gt> 0 && buf != \\[aq]\\en\\[aq])\n" +" continue;\n" +" break;\n" +" }\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " if (fds[1].revents & POLLIN) {\n" +msgstr " if (fds[1].revents & POLLIN) {\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " /* Fanotify events are available. */\n" +msgstr " /* Доступны события fanotify. */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" handle_events(fd);\n" +" }\n" +" }\n" +" }\n" +msgstr "" +" handle_events(fd);\n" +" }\n" +" }\n" +" }\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" printf(\"Listening for events stopped.\\en\");\n" +" exit(EXIT_SUCCESS);\n" +"}\n" +msgstr "" +" printf(\"Ожидание событий прекращено.\\en\");\n" +" exit(EXIT_SUCCESS);\n" +"}\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, fuzzy, no-wrap +#| msgid "" +#| "# B<./fanotify_fid /home/user>\n" +#| "Listening for events.\n" +#| "FAN_CREATE (file created): Directory /home/user has been modified.\n" +#| "All events processed successfully. Program exiting.\n" +msgid "" +"# B<./fanotify_fid /home/user>\n" +"Listening for events.\n" +"FAN_CREATE (file created):\n" +" Directory /home/user has been modified.\n" +" Entry \\[aq]testfile.txt\\[aq] is not a subdirectory.\n" +"All events processed successfully. Program exiting.\n" +msgstr "" +"# B<./fanotify_fid /home/user>\n" +"Ожидание событий.\n" +"FAN_CREATE (создан файл): Каталог /home/user изменён.\n" +"Все события успешно обработаны. Завершение программы.\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "$ B<touch /home/user/testfile.txt> # In another terminal\n" +msgstr "$ B<touch /home/user/testfile.txt> # в другом терминале\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, fuzzy, no-wrap +#| msgid "" +#| "# B<./fanotify_fid /home/user>\n" +#| "Listening for events.\n" +#| "FAN_CREATE | FAN_ONDIR (subdirectory created):\n" +#| " Directory /home/user has been modified.\n" +#| "All events processed successfully. Program exiting.\n" +msgid "" +"# B<./fanotify_fid /home/user>\n" +"Listening for events.\n" +"FAN_CREATE | FAN_ONDIR (subdirectory created):\n" +" Directory /home/user has been modified.\n" +" Entry \\[aq]testdir\\[aq] is a subdirectory.\n" +"All events processed successfully. Program exiting.\n" +msgstr "" +"# B<./fanotify_fid /home/user>\n" +"Ожидание событий.\n" +"FAN_CREATE | FAN_ONDIR (создан подкаталог):\n" +" Каталог /home/user изменён.\n" +"Все события успешно обработаны. Завершение программы.\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "$ B<mkdir -p /home/user/testdir> # In another terminal\n" +msgstr "$ B<mkdir -p /home/user/testdir> # в другом терминале\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +"#define _GNU_SOURCE\n" +"#include E<lt>errno.hE<gt>\n" +"#include E<lt>fcntl.hE<gt>\n" +"#include E<lt>limits.hE<gt>\n" +"#include E<lt>stdio.hE<gt>\n" +"#include E<lt>stdlib.hE<gt>\n" +"#include E<lt>sys/types.hE<gt>\n" +"#include E<lt>sys/stat.hE<gt>\n" +"#include E<lt>sys/fanotify.hE<gt>\n" +"#include E<lt>unistd.hE<gt>\n" +msgstr "" +"#define _GNU_SOURCE\n" +"#include E<lt>errno.hE<gt>\n" +"#include E<lt>fcntl.hE<gt>\n" +"#include E<lt>limits.hE<gt>\n" +"#include E<lt>stdio.hE<gt>\n" +"#include E<lt>stdlib.hE<gt>\n" +"#include E<lt>sys/types.hE<gt>\n" +"#include E<lt>sys/stat.hE<gt>\n" +"#include E<lt>sys/fanotify.hE<gt>\n" +"#include E<lt>unistd.hE<gt>\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "#define BUF_SIZE 256\n" +msgstr "#define BUF_SIZE 256\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +"int\n" +"main(int argc, char *argv[])\n" +"{\n" +" int fd, ret, event_fd, mount_fd;\n" +" ssize_t len, path_len;\n" +" char path[PATH_MAX];\n" +" char procfd_path[PATH_MAX];\n" +" char events_buf[BUF_SIZE];\n" +" struct file_handle *file_handle;\n" +" struct fanotify_event_metadata *metadata;\n" +" struct fanotify_event_info_fid *fid;\n" +" const char *file_name;\n" +" struct stat sb;\n" +msgstr "" +"int\n" +"main(int argc, char *argv[])\n" +"{\n" +" int fd, ret, event_fd, mount_fd;\n" +" ssize_t len, path_len;\n" +" char path[PATH_MAX];\n" +" char procfd_path[PATH_MAX];\n" +" char events_buf[BUF_SIZE];\n" +" struct file_handle *file_handle;\n" +" struct fanotify_event_metadata *metadata;\n" +" struct fanotify_event_info_fid *fid;\n" +" const char *file_name;\n" +" struct stat sb;\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" if (argc != 2) {\n" +" fprintf(stderr, \"Invalid number of command line arguments.\\en\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" +" if (argc != 2) {\n" +" fprintf(stderr, \"Некорректное количество аргументов в командной строке.\\en\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" mount_fd = open(argv[1], O_DIRECTORY | O_RDONLY);\n" +" if (mount_fd == -1) {\n" +" perror(argv[1]);\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" +" mount_fd = open(argv[1], O_DIRECTORY | O_RDONLY);\n" +" if (mount_fd == -1) {\n" +" perror(argv[1]);\n" +" exit(EXIT_FAILURE);\n" +" }\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, fuzzy, no-wrap +#| msgid "" +#| " /* Create an fanotify file descriptor with FAN_REPORT_FID as a flag\n" +#| " so that program can receive fid events. */\n" +msgid "" +" /* Create an fanotify file descriptor with FAN_REPORT_DFID_NAME as\n" +" a flag so that program can receive fid events with directory\n" +" entry name. */\n" +msgstr "" +" /* создаём файловый дескриптор fanotify с флагом FAN_REPORT_FID для\n" +" того, чтобы программа могла принимать события fid. */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" fd = fanotify_init(FAN_CLASS_NOTIF | FAN_REPORT_DFID_NAME, 0);\n" +" if (fd == -1) {\n" +" perror(\"fanotify_init\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" +" fd = fanotify_init(FAN_CLASS_NOTIF | FAN_REPORT_DFID_NAME, 0);\n" +" if (fd == -1) {\n" +" perror(\"fanotify_init\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " /* Place a mark on the filesystem object supplied in argv[1]. */\n" +msgstr " /* ставим метку на объект файловой системы, заданный в argv[1]. */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" ret = fanotify_mark(fd, FAN_MARK_ADD | FAN_MARK_ONLYDIR,\n" +" FAN_CREATE | FAN_ONDIR,\n" +" AT_FDCWD, argv[1]);\n" +" if (ret == -1) {\n" +" perror(\"fanotify_mark\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" +" ret = fanotify_mark(fd, FAN_MARK_ADD | FAN_MARK_ONLYDIR,\n" +" FAN_CREATE | FAN_ONDIR,\n" +" AT_FDCWD, argv[1]);\n" +" if (ret == -1) {\n" +" perror(\"fanotify_mark\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " /* Read events from the event queue into a buffer. */\n" +msgstr " /* Читаем события из очереди событий в буфер. */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" len = read(fd, events_buf, sizeof(events_buf));\n" +" if (len == -1 && errno != EAGAIN) {\n" +" perror(\"read\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" +" len = read(fd, events_buf, sizeof(events_buf));\n" +" if (len == -1 && errno != EAGAIN) {\n" +" perror(\"read\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " /* Process all events within the buffer. */\n" +msgstr " /* Обрабатываем все события в буфере. */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" for (metadata = (struct fanotify_event_metadata *) events_buf;\n" +" FAN_EVENT_OK(metadata, len);\n" +" metadata = FAN_EVENT_NEXT(metadata, len)) {\n" +" fid = (struct fanotify_event_info_fid *) (metadata + 1);\n" +" file_handle = (struct file_handle *) fid-E<gt>handle;\n" +msgstr "" +" for (metadata = (struct fanotify_event_metadata *) events_buf;\n" +" FAN_EVENT_OK(metadata, len);\n" +" metadata = FAN_EVENT_NEXT(metadata, len)) {\n" +" fid = (struct fanotify_event_info_fid *) (metadata + 1);\n" +" file_handle = (struct file_handle *) fid-E<gt>handle;\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " /* Ensure that the event info is of the correct type. */\n" +msgstr " /* Проверим, что информация о событии правильного типа. */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" if (fid-E<gt>hdr.info_type == FAN_EVENT_INFO_TYPE_FID ||\n" +" fid-E<gt>hdr.info_type == FAN_EVENT_INFO_TYPE_DFID) {\n" +" file_name = NULL;\n" +" } else if (fid-E<gt>hdr.info_type == FAN_EVENT_INFO_TYPE_DFID_NAME) {\n" +" file_name = file_handle-E<gt>f_handle +\n" +" file_handle-E<gt>handle_bytes;\n" +" } else {\n" +" fprintf(stderr, \"Received unexpected event info type.\\en\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" if (metadata-E<gt>mask == FAN_CREATE)\n" +" printf(\"FAN_CREATE (file created):\\en\");\n" +msgstr "" +" if (metadata-E<gt>mask == FAN_CREATE)\n" +" printf(\"FAN_CREATE (создан файл):\\en\");\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" if (metadata-E<gt>mask == (FAN_CREATE | FAN_ONDIR))\n" +" printf(\"FAN_CREATE | FAN_ONDIR (subdirectory created):\\en\");\n" +msgstr "" +" if (metadata-E<gt>mask == (FAN_CREATE | FAN_ONDIR))\n" +" printf(\"FAN_CREATE | FAN_ONDIR (создан подкаталог):\\en\");\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, fuzzy, no-wrap +#| msgid "" +#| " /* metadata-E<gt>fd is set to FAN_NOFD when FAN_REPORT_FID is enabled.\n" +#| " To obtain a file descriptor for the file object corresponding to\n" +#| " an event you can use the struct file_handle that\\(aqs provided\n" +#| " within the fanotify_event_info_fid in conjunction with the\n" +#| " open_by_handle_at(2) system call. A check for ESTALE is done\n" +#| " to accommodate for the situation where the file handle for the\n" +#| " object was deleted prior to this system call. */\n" +msgid "" +"\t/* metadata-E<gt>fd is set to FAN_NOFD when the group identifies\n" +"\t objects by file handles. To obtain a file descriptor for\n" +"\t the file object corresponding to an event you can use the\n" +"\t struct file_handle that\\[aq]s provided within the\n" +"\t fanotify_event_info_fid in conjunction with the\n" +"\t open_by_handle_at(2) system call. A check for ESTALE is\n" +"\t done to accommodate for the situation where the file handle\n" +"\t for the object was deleted prior to this system call. */\n" +msgstr "" +" /* metadata-E<gt>fd присваивается FAN_NOFD, если включён\n" +" FAN_REPORT_FID. Чтобы получить файловый дескриптор для\n" +" файлового объекта, соответствующего событию, можно\n" +" использовать struct file_handle, которая находится\n" +" внутри fanotify_event_info_fid и системный вызов\n" +" open_by_handle_at(2). Проверка на ESTALE нужна, чтобы\n" +" учесть ситуацию, когда файловый описатель для объекта\n" +" был удалён до этого системного вызова. */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" event_fd = open_by_handle_at(mount_fd, file_handle, O_RDONLY);\n" +" if (event_fd == -1) {\n" +" if (errno == ESTALE) {\n" +" printf(\"File handle is no longer valid. \"\n" +" \"File has been deleted\\en\");\n" +" continue;\n" +" } else {\n" +" perror(\"open_by_handle_at\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +" }\n" +msgstr "" +" event_fd = open_by_handle_at(mount_fd, file_handle, O_RDONLY);\n" +" if (event_fd == -1) {\n" +" if (errno == ESTALE) {\n" +" printf(\"Обработчик файл более недействителен. \"\n" +" \"Файл был удалён\\en\");\n" +" continue;\n" +" } else {\n" +" perror(\"open_by_handle_at\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +" }\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" snprintf(procfd_path, sizeof(procfd_path), \"/proc/self/fd/%d\",\n" +" event_fd);\n" +msgstr "" +" snprintf(procfd_path, sizeof(procfd_path), \"/proc/self/fd/%d\",\n" +" event_fd);\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " /* Retrieve and print the path of the modified dentry. */\n" +msgstr " /* Получаем и выводим путь изменённой dentry. */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" path_len = readlink(procfd_path, path, sizeof(path) - 1);\n" +" if (path_len == -1) {\n" +" perror(\"readlink\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" +" path_len = readlink(procfd_path, path, sizeof(path) - 1);\n" +" if (path_len == -1) {\n" +" perror(\"readlink\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, fuzzy, no-wrap +#| msgid "" +#| " path[path_len] = \\(aq\\e0\\(aq;\n" +#| " printf(\"\\etDirectory \\(aq%s\\(aq has been modified.\\en\", path);\n" +msgid "" +" path[path_len] = \\[aq]\\e0\\[aq];\n" +" printf(\"\\etDirectory \\[aq]%s\\[aq] has been modified.\\en\", path);\n" +msgstr "" +" path[path_len] = \\(aq\\e0\\(aq;\n" +" printf(\"\\etКаталог \\(aq%s\\(aq изменён.\\en\", path);\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" if (file_name) {\n" +" ret = fstatat(event_fd, file_name, &sb, 0);\n" +" if (ret == -1) {\n" +" if (errno != ENOENT) {\n" +" perror(\"fstatat\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +" printf(\"\\etEntry \\[aq]%s\\[aq] does not exist.\\en\", file_name);\n" +" } else if ((sb.st_mode & S_IFMT) == S_IFDIR) {\n" +" printf(\"\\etEntry \\[aq]%s\\[aq] is a subdirectory.\\en\", file_name);\n" +" } else {\n" +" printf(\"\\etEntry \\[aq]%s\\[aq] is not a subdirectory.\\en\",\n" +" file_name);\n" +" }\n" +" }\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " /* Close associated file descriptor for this event. */\n" +msgstr " /* Закрываем связанный файловый дескриптор этого события. */\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" close(event_fd);\n" +" }\n" +msgstr "" +" close(event_fd);\n" +" }\n" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" printf(\"All events processed successfully. Program exiting.\\en\");\n" +" exit(EXIT_SUCCESS);\n" +"}\n" +msgstr "" +" printf(\"Все события успешно обработаны. Завершение программы.\\en\");\n" +" exit(EXIT_SUCCESS);\n" +"}\n" + +#. type: TH +#: debian-unstable opensuse-tumbleweed +#, no-wrap +msgid "2023-05-03" +msgstr "3 мая 2023 г." + +#. type: TH +#: debian-unstable opensuse-tumbleweed +#, no-wrap +msgid "Linux man-pages 6.05.01" +msgstr "Linux man-pages 6.05.01" + +#. type: TH +#: opensuse-leap-15-6 +#, no-wrap +msgid "2023-04-03" +msgstr "3 апреля 2023 г." + +#. type: TH +#: opensuse-leap-15-6 +#, no-wrap +msgid "Linux man-pages 6.04" +msgstr "Linux man-pages 6.04" |