Struct fanotify::low_level::FanotifyEventMetadata
source · #[repr(C)]pub struct FanotifyEventMetadata {
pub event_len: __u32,
pub vers: __u8,
pub reserved: __u8,
pub metadata_len: __u16,
pub mask: __u64,
pub fd: __s32,
pub pid: __s32,
}
Fields§
§event_len: __u32
This is the length of the data for the current event and the
offset to the next event in the buffer. Without
FAN_REPORT_FID
, the value of event_len is always
FAN_EVENT_METADATA_LEN. With FAN_REPORT_FID
, event_len also
includes the variable length file identifier.
vers: __u8
This 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: __u8
This field is not used.
metadata_len: __u16
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 implemen‐ tation.
mask: __u64
This is a bit mask describing the event (see below).
fd: __s32
This 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_NOFDfor 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: __s32
If 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 FanotifyEventMetadata
impl Clone for FanotifyEventMetadata
source§fn clone(&self) -> FanotifyEventMetadata
fn clone(&self) -> FanotifyEventMetadata
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more