#, fuzzy msgid "" msgstr "" "Project-Id-Version: man-pages-l10n VERSION\n" "POT-Creation-Date: 2014-07-17 17:57+0900\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. type: TH #: man-pages/man7/fanotify.7:25 #, no-wrap msgid "FANOTIFY" msgstr "" #. type: TH #: man-pages/man7/fanotify.7:25 #, no-wrap msgid "2014-05-21" msgstr "" #. type: TH #: man-pages/man7/fanotify.7:25 #, no-wrap msgid "Linux" msgstr "" #. type: TH #: man-pages/man7/fanotify.7:25 #, no-wrap msgid "Linux Programmer's Manual" msgstr "" #. type: SH #: man-pages/man7/fanotify.7:26 #, no-wrap msgid "NAME" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:28 msgid "fanotify - monitoring filesystem events" msgstr "" #. type: SH #: man-pages/man7/fanotify.7:28 #, no-wrap msgid "DESCRIPTION" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:37 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(7) for " "details of an API that does notify those events.)" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:44 msgid "" "Additional capabilities compared to the B(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 "" #. type: Plain text #: man-pages/man7/fanotify.7:52 msgid "" "The following system calls are used with this API: B(2), " "B(2), B(2), B(2), and B(2)." msgstr "" #. type: SS #: man-pages/man7/fanotify.7:52 #, no-wrap msgid "fanotify_init(), fanotify_mark(), and notification groups" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:57 msgid "" "The B(2) system call creates and initializes an fanotify " "notification group and returns a file descriptor referring to it." msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:61 msgid "" "An fanotify notification group is a kernel-internal object that holds a list " "of files, directories, and mount points for which events shall be created." msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:72 msgid "" "For each entry in an fanotify notification group, two bit masks exist: the " "I mask and the I 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 mount point or directory to be marked for receiving events, while at the " "same time ignoring events for specific objects under that mount point or " "directory." msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:78 msgid "" "The B(2) system call adds a file, directory, or mount to a " "notification group and specifies which events shall be reported (or " "ignored), or removes or modifies such an entry." msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:91 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." msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:98 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, the respective entries survive. " "If files or directories are deleted or mounts are unmounted, the " "corresponding entries are deleted." msgstr "" #. type: SS #: man-pages/man7/fanotify.7:98 #, no-wrap msgid "The event queue" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:107 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(2) or similar) from the fanotify " "file descriptor returned by B(2)." msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:121 msgid "" "Two types of events are generated: I events and I " "events. Notification events are merely informative and require no action to " "be taken by the receiving application except for closing the file descriptor " "passed in the event (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." msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:128 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 "" #. type: SS #: man-pages/man7/fanotify.7:128 #, no-wrap msgid "Reading fanotify events" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:140 msgid "" "Calling B(2) for the file descriptor returned by B(2) " "blocks (if the flag B is not specified in the call to " "B(2)) until either a file event occurs or the call is " "interrupted by a signal (see B(7))." msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:144 msgid "" "After a successful B(2), the read buffer contains one or more of the " "following structures:" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:156 #, 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 "" #. type: Plain text #: man-pages/man7/fanotify.7:163 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(2)." msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:168 msgid "" "The return value of B(2) is the number of bytes placed in the buffer, " "or -1 in case of an error (but see BUGS)." msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:172 msgid "The fields of the I structure are as follows:" msgstr "" #. type: TP #: man-pages/man7/fanotify.7:172 #, no-wrap msgid "I" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:182 msgid "" "This is the length of the data for the current event and the offset to the " "next event in the buffer. In the current implementation, the value of " "I is always B. However, the API is " "designed to allow variable-length structures to be returned in the future." msgstr "" #. type: TP #: man-pages/man7/fanotify.7:182 #, no-wrap msgid "I" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:191 msgid "" "This field holds a version number for the structure. It must be compared to " "B to verify that the structures returned at " "runtime match the structures defined at compile time. In case of a " "mismatch, the application should abandon trying to use the fanotify file " "descriptor." msgstr "" #. type: TP #: man-pages/man7/fanotify.7:191 #, no-wrap msgid "I" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:194 msgid "This field is not used." msgstr "" #. type: TP #: man-pages/man7/fanotify.7:194 #, no-wrap msgid "I" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:200 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 #: man-pages/man7/fanotify.7:200 #, no-wrap msgid "I" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:203 msgid "This is a bit mask describing the event (see below)." msgstr "" #. type: TP #: man-pages/man7/fanotify.7:203 man-pages/man7/fanotify.7:360 #, no-wrap msgid "I" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:211 msgid "" "This is an open file descriptor for the object being accessed, or " "B if a queue overflow occurred. 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 "" #. type: Plain text #: man-pages/man7/fanotify.7:224 msgid "" "When calling B(2), the caller may specify (via the " "I 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 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 "" #. type: TP #: man-pages/man7/fanotify.7:224 #, no-wrap msgid "I" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:232 msgid "" "This is the ID of the process that caused the event. A program listening to " "fanotify events can compare this PID to the PID returned by B(2), to " "determine whether the event is caused by the listener itself, or is due to a " "file access by another process." msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:242 msgid "" "The bit mask in I 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 "" #. type: Plain text #: man-pages/man7/fanotify.7:246 msgid "The bits that may appear in I are as follows:" msgstr "" #. type: TP #: man-pages/man7/fanotify.7:246 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:249 msgid "A file or a directory (but see BUGS) was accessed (read)." msgstr "" #. type: TP #: man-pages/man7/fanotify.7:249 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:252 msgid "A file or a directory was opened." msgstr "" #. type: TP #: man-pages/man7/fanotify.7:252 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:255 msgid "A file was modified." msgstr "" #. type: TP #: man-pages/man7/fanotify.7:255 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:262 msgid "" "A file that was opened for writing (B or B) was closed." msgstr "" #. type: TP #: man-pages/man7/fanotify.7:262 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:267 msgid "" "A file or directory that was opened read-only (B) was closed." msgstr "" #. type: TP #: man-pages/man7/fanotify.7:267 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:274 msgid "" "The event queue exceeded the limit of 16384 entries. This limit can be " "overridden by specifying the B flag when calling " "B(2)." msgstr "" #. type: TP #: man-pages/man7/fanotify.7:274 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:283 msgid "" "An application wants to read a file or directory, for example using " "B(2) or B(2). The reader must write a response (as " "described below) that determines whether the permission to access the " "filesystem object shall be granted." msgstr "" #. type: TP #: man-pages/man7/fanotify.7:283 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:288 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: Plain text #: man-pages/man7/fanotify.7:290 msgid "To check for any close event, the following bit mask may be used:" msgstr "" #. type: TP #: man-pages/man7/fanotify.7:290 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:294 msgid "A file was closed. This is a synonym for:" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:296 #, no-wrap msgid " FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE\n" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:301 msgid "" "The following macros are provided to iterate over a buffer containing " "fanotify event metadata returned by a B(2) from an fanotify file " "descriptor:" msgstr "" #. type: TP #: man-pages/man7/fanotify.7:301 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:310 msgid "" "This macro checks the remaining length I of the buffer I against " "the length of the metadata structure and the I field of the first " "metadata structure in the buffer." msgstr "" #. type: TP #: man-pages/man7/fanotify.7:310 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:329 msgid "" "This macro uses the length indicated in the I field of the " "metadata structure pointed to by I to calculate the address of the " "next metadata structure that follows I. I 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, and reduces " "I by the number of bytes in the the metadata structure that has been " "skipped over (i.e., it subtracts Ievent_len> from I)." msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:331 msgid "In addition, there is:" msgstr "" #. type: TP #: man-pages/man7/fanotify.7:331 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:337 msgid "" "This macro returns the size (in bytes) of the structure " "I. This is the minimum size (and currently the " "only size) of any event metadata." msgstr "" #. type: SS #: man-pages/man7/fanotify.7:337 #, no-wrap msgid "Monitoring an fanotify file descriptor for events" msgstr "" #. type: Plain text #: man-pages/man7/fanotify.7:344 msgid "" "When an fanotify event occurs, the fanotify file descriptor indicates as " "readable when passed to B(7), B(2), or B