⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

Module inotify

Module inotify 

Source
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_RECURSIVE flag (custom extension)
  • Thread-safe via atomic operations and spin::RwLock

Structs§

InotifyEvent
An inotify event delivered to userspace.
InotifyInstance
An inotify instance, representing one open inotify file descriptor.
InotifyStats
Statistics about the inotify subsystem.
WatchDescriptor
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.