use libc::{__s32, __u16, __u32, __u64, __u8, c_int};
use std::ffi::OsStr;
#[allow(unused_imports)]
use crate::flags::*;
#[derive(Debug, Clone, Copy)]
#[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,
}
#[derive(Debug, Clone, Copy)]
#[allow(non_camel_case_types)]
struct __kernel_fsid_t {
#[allow(dead_code)]
val: [c_int; 2],
}
#[derive(Debug, Clone, Copy)]
#[repr(C)]
pub struct fanotify_event_info_header {
pub info_type: __u8,
pub pad: __u8,
pub len: __u16,
}
#[derive(Debug, Clone, Copy)]
#[repr(C)]
struct fanotify_event_info_fid {
hdr: fanotify_event_info_header,
fsid: __kernel_fsid_t,
file_handle: __u8,
}
#[derive(Debug)]
#[repr(C)]
pub struct fanotify_response {
pub fd: __s32,
pub response: __u32,
}
pub trait Path {
fn as_os_str(&self) -> &OsStr;
}
impl Path for std::path::Path {
fn as_os_str(&self) -> &OsStr {
self.as_os_str()
}
}
impl Path for str {
fn as_os_str(&self) -> &OsStr {
OsStr::new(self)
}
}
impl Path for String {
fn as_os_str(&self) -> &OsStr {
OsStr::new(self.as_str())
}
}