Expand description
inotify – File Event Monitoring
Provides inotify-style file event monitoring for the VFS layer. Watches can be placed on files and directories to receive notifications when filesystem events occur (create, delete, modify, move, etc.).
Key features:
- Watch descriptor management (
inotify_init,inotify_add_watch,inotify_rm_watch) - Bounded per-instance event queues with configurable max (default 4096)
- Event coalescing: identical consecutive events are deduplicated
- Recursive watch support via
IN_RECURSIVEflag (custom extension) - Thread-safe via atomic operations and spin::RwLock
Structs§
- Inotify
Event - An inotify event delivered to userspace.
- Inotify
Instance - An inotify instance, representing one open inotify file descriptor.
- Inotify
Stats - Statistics about the inotify subsystem.
- Watch
Descriptor - A watch descriptor tracking a single watched path/inode.
Constants§
- IN_
ACCESS - File was accessed (read).
- IN_
ALL_ EVENTS - Combination of all standard event types.
- IN_
ATTRIB - File attributes changed (chmod, chown, etc.).
- IN_
CLOSE_ NOWRITE - File not opened for writing was closed.
- IN_
CLOSE_ WRITE - File opened for writing was closed.
- IN_
CREATE - File/directory created in watched directory.
- IN_
DELETE - File/directory deleted from watched directory.
- IN_
DELETE_ SELF - Watched file/directory was itself deleted.
- IN_
ISDIR - Event occurred against a directory (set in returned events, not in watch mask).
- IN_
MODIFY - File was modified (write).
- IN_
MOVED_ FROM - File/directory moved out of watched directory.
- IN_
MOVED_ TO - File/directory moved into watched directory.
- IN_
MOVE_ SELF - Watched file/directory was itself moved.
- IN_OPEN
- File was opened.
- IN_
RECURSIVE - Watch subdirectories recursively (VeridianOS extension, not in Linux inotify).
Functions§
- generate_
move_ cookie - Generate a new cookie for pairing MOVED_FROM / MOVED_TO events.
- get_
stats - Get current inotify subsystem statistics.
- inotify_
add_ watch - Add a watch to an inotify instance.
- inotify_
close - Destroy an inotify instance, removing all its watches.
- inotify_
init - Initialize a new inotify instance.
- inotify_
init_ with_ limits - Initialize a new inotify instance with custom limits.
- inotify_
pending - Check how many events are pending for an inotify instance.
- inotify_
read - Read pending events from an inotify instance.
- inotify_
rm_ watch - Remove a watch from an inotify instance.
- notify_
child_ event - Convenience wrapper: notify a directory watch about an event on a child.
- notify_
event - Notify all watchers of a filesystem event on the given inode.