diff options
author | Amir Goldstein <amir73il@gmail.com> | 2025-03-30 14:55:36 +0200 |
---|---|---|
committer | Alejandro Colomar <alx@kernel.org> | 2025-04-02 23:04:25 +0200 |
commit | dae94470bca488dfc4962c2988f24f286a8d2326 (patch) | |
tree | be14cfac5b1533eef35de678122bc3c267a11663 /man/man7 | |
parent | 7ec4d0b3d478f88ae316b748a41a8b12694efe5d (diff) | |
download | man-pages-dae94470bca488dfc4962c2988f24f286a8d2326.tar.gz |
man/man?/fanotify*: Document FAN_PRE_ACCESS event
The new FAN_PRE_ACCESS events are created before access to a file range,
to provides an opportunity for the event listener to modify the content
of the object before the user can accesss it.
Those events are available for group in class FAN_CLASS_PRE_CONTENT
They are reported with FAN_EVENT_INFO_TYPE_RANGE info record.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Message-ID: <20250330125536.1408939-1-amir73il@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'man/man7')
-rw-r--r-- | man/man7/fanotify.7 | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/man/man7/fanotify.7 b/man/man7/fanotify.7 index 712d5dfff4..0e754c699d 100644 --- a/man/man7/fanotify.7 +++ b/man/man7/fanotify.7 @@ -247,6 +247,26 @@ struct fanotify_event_info_error { .EE .in .P +In case of +.B FAN_PRE_ACCESS +events, +an additional information record describing the access range +is returned alongside the generic +.I fanotify_event_metadata +structure within the read buffer. +This structure is defined as follows: +.P +.in +4n +.EX +struct fanotify_event_info_range { + struct fanotify_event_info_header hdr; + __u32 pad; + __u64 offset; + __u64 count; +}; +.EE +.in +.P All information records contain a nested structure of type .IR fanotify_event_info_header . This structure holds meta-information about the information record @@ -510,8 +530,9 @@ The value of this field can be set to one of the following: .BR FAN_EVENT_INFO_TYPE_FID , .BR FAN_EVENT_INFO_TYPE_DFID , .BR FAN_EVENT_INFO_TYPE_DFID_NAME , -or -.BR FAN_EVENT_INFO_TYPE_PIDFD . +.BR FAN_EVENT_INFO_TYPE_PIDFD , +.BR FAN_EVENT_INFO_TYPE_ERROR , +.BR FAN_EVENT_INFO_TYPE_RANGE . The value set for this field is dependent on the flags that have been supplied to .BR fanotify_init (2). @@ -713,6 +734,24 @@ Identifies the type of error that occurred. This is a counter of the number of errors suppressed since the last error was read. .P +The fields of the +.I fanotify_event_info_range +structure are as follows: +.TP +.I hdr +This is a structure of type +.IR fanotify_event_info_header . +The +.I info_type +field is set to +.BR FAN_EVENT_INFO_TYPE_RANGE . +.TP +.I count +The number of bytes being read or written to the file. +.TP +.I offset +The offset from which bytes are read or written to the file. +.P The following macros are provided to iterate over a buffer containing fanotify event metadata returned by a .BR read (2) |