| ... | ... | @@ -357,6 +357,14 @@ pub fn inotify_rm_watch(fd: i32, wd: i32) usize { |
| 357 | 357 | return syscall2(.inotify_rm_watch, @as(usize, @bitCast(@as(isize, fd))), @as(usize, @bitCast(@as(isize, wd)))); |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | pub fn fanotify_init(flags: u32, event_f_flags: u32) usize { |
| 361 | return syscall2(.fanotify_init, flags, event_f_flags); |
| 362 | } |
| 363 | |
| 364 | pub fn fanotify_mark(fd: i32, flags: u32, mask: u64, dirfd: i32, pathname: ?[*:0]const u8) usize { |
| 365 | return syscall5(.fanotify_mark, @as(usize, @bitCast(@as(isize, fd))), flags, mask, @as(usize, @bitCast(@as(isize, dirfd))), @intFromPtr(pathname)); |
| 366 | } |
| 367 | |
| 360 | 368 | pub fn readlink(noalias path: [*:0]const u8, noalias buf_ptr: [*]u8, buf_len: usize) usize { |
| 361 | 369 | if (@hasField(SYS, "readlink")) { |
| 362 | 370 | return syscall3(.readlink, @intFromPtr(path), @intFromPtr(buf_ptr), buf_len); |
| ... | ... | @@ -3165,6 +3173,58 @@ pub const IN = struct { |
| 3165 | 3173 | pub const ONESHOT = 0x80000000; |
| 3166 | 3174 | }; |
| 3167 | 3175 | |
| 3176 | pub const FAN = struct { |
| 3177 | pub const ACCESS = 0x00000001; |
| 3178 | pub const MODIFY = 0x00000002; |
| 3179 | pub const CLOSE_WRITE = 0x00000008; |
| 3180 | pub const CLOSE_NOWRITE = 0x00000010; |
| 3181 | pub const OPEN = 0x00000020; |
| 3182 | pub const Q_OVERFLOW = 0x00004000; |
| 3183 | pub const OPEN_PERM = 0x00010000; |
| 3184 | pub const ACCESS_PERM = 0x00020000; |
| 3185 | pub const ONDIR = 0x40000000; |
| 3186 | pub const EVENT_ON_CHILD = 0x08000000; |
| 3187 | pub const CLOSE = CLOSE_WRITE | CLOSE_NOWRITE; |
| 3188 | pub const CLOEXEC = 0x00000001; |
| 3189 | pub const NONBLOCK = 0x00000002; |
| 3190 | pub const CLASS_NOTIF = 0x00000000; |
| 3191 | pub const CLASS_CONTENT = 0x00000004; |
| 3192 | pub const CLASS_PRE_CONTENT = 0x00000008; |
| 3193 | pub const ALL_CLASS_BITS = CLASS_NOTIF | CLASS_CONTENT | CLASS_PRE_CONTENT; |
| 3194 | pub const UNLIMITED_QUEUE = 0x00000010; |
| 3195 | pub const UNLIMITED_MARKS = 0x00000020; |
| 3196 | pub const ALL_INIT_FLAGS = CLOEXEC | NONBLOCK | ALL_CLASS_BITS | UNLIMITED_QUEUE | UNLIMITED_MARKS; |
| 3197 | pub const MARK_ADD = 0x00000001; |
| 3198 | pub const MARK_REMOVE = 0x00000002; |
| 3199 | pub const MARK_DONT_FOLLOW = 0x00000004; |
| 3200 | pub const MARK_ONLYDIR = 0x00000008; |
| 3201 | pub const MARK_MOUNT = 0x00000010; |
| 3202 | pub const MARK_IGNORED_MASK = 0x00000020; |
| 3203 | pub const MARK_IGNORED_SURV_MODIFY = 0x00000040; |
| 3204 | pub const MARK_FLUSH = 0x00000080; |
| 3205 | pub const ALL_MARK_FLAGS = MARK_ADD | MARK_REMOVE | MARK_DONT_FOLLOW | MARK_ONLYDIR | MARK_MOUNT | MARK_IGNORED_MASK | MARK_IGNORED_SURV_MODIFY | MARK_FLUSH; |
| 3206 | pub const ALL_EVENTS = ACCESS | MODIFY | CLOSE | OPEN; |
| 3207 | pub const ALL_PERM_EVENTS = OPEN_PERM | ACCESS_PERM; |
| 3208 | pub const ALL_OUTGOING_EVENTS = ALL_EVENTS | ALL_PERM_EVENTS | Q_OVERFLOW; |
| 3209 | pub const ALLOW = 0x01; |
| 3210 | pub const DENY = 0x02; |
| 3211 | }; |
| 3212 | |
| 3213 | pub const fanotify_event_metadata = extern struct { |
| 3214 | event_len: u32, |
| 3215 | vers: u8, |
| 3216 | reserved: u8, |
| 3217 | metadata_len: u16, |
| 3218 | mask: u64 align(8), |
| 3219 | fd: i32, |
| 3220 | pid: i32, |
| 3221 | }; |
| 3222 | |
| 3223 | pub const fanotify_response = extern struct { |
| 3224 | fd: i32, |
| 3225 | response: u32, |
| 3226 | }; |
| 3227 | |
| 3168 | 3228 | pub const S = struct { |
| 3169 | 3229 | pub const IFMT = 0o170000; |
| 3170 | 3230 | |