Function naughtyfy::api::fanotify_read
source · pub fn fanotify_read(
fanotify_fd: i32
) -> Result<Vec<fanotify_event_metadata>, Error>Expand description
This function ateempts to read from a file descriptor fanotify_fd
into a Vec<fanotify_event_metadata> and return a Result.
Argument
fd- file descriptor returned byfanotify_init()
Example
let fd = fanotify_init(FAN_CLASS_NOTIF, 0).unwrap();
fanotify_mark(fd, FAN_MARK_ADD | FAN_MARK_MOUNT, FAN_ACCESS, libc::AT_FDCWD, "./");
let fan_events = fanotify_read(fd);
println!("{fan_events:#?}");