fanotify_close in naughtyfy::api - Rust
Description: Closes the file descriptor returned by [`fanotify_init()`]
Keywords: rust, rustlang, rust-lang, fanotify_close

# Function naughtyfy::api::fanotify_close

source ·

    pub fn fanotify_close(fd: i32) -> Result<(), Error>

Expand description

Closes the file descriptor returned by `fanotify_init()`

## Argument

- `fd` - `fd` - file descriptor returned by `fanotify_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:#?}");