Struct naughtyfy::types::fanotify_event_metadata
source · #[repr(C)]pub struct fanotify_event_metadata {
pub event_len: __u32,
pub vers: __u8,
pub reserved: __u8,
pub metadata_len: __u16,
pub mask: __u64,
pub fd: __s32,
pub pid: __s32,
}Expand description
After a successful read(2), the read buffer contains the following structure
Fields§
§event_len: __u32This 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 event_len is always FAN_EVENT_METADATA_LEN. For
a group that identifies filesystem objects by file
handles, event_len also includes the variable length file
identifier records.
vers: __u8This field holds a version number for the structure. It
must be compared to 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.
reserved: __u8This field is not used.
metadata_len: __u16This 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.
mask: __u64This is a bit mask describing the event (see below).
fd: __s32This is an open file descriptor for the object being accessed,or FAN_NOFD if a queue overflow occurred.
If the fanotify file descriptor has been initialized using FAN_REPORT_FID,
applications should expect this value to be set to 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.
When calling fanotify_init(2), the caller may specify (via the 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)
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,
noadditional events will be created.
pid: __s32If flag FAN_REPORT_TID was set in 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.
Trait Implementations§
source§impl Clone for fanotify_event_metadata
impl Clone for fanotify_event_metadata
source§fn clone(&self) -> fanotify_event_metadata
fn clone(&self) -> fanotify_event_metadata
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more