Report queue overflows instead of dropping them

`IN_Q_OVERFLOW` arrives with watch descriptor -1, so the path lookup
failed and the event was silently discarded. It is now delivered
with an empty path so consumers can rescan after the kernel dropped
events.
This commit is contained in:
T. R. Bernstein
2026-09-13 23:06:28 +02:00
parent 68f49e254c
commit 6375a23328
4 changed files with 43 additions and 0 deletions
+2
View File
@@ -118,6 +118,8 @@ Watch flags: `.dontFollow`, `.onlyDir`, `.oneShot`.
Kernel-only flags returned in events: `.isDir`, `.ignored`, `.queueOverflow`, `.unmount`.
When the kernel queue overflows, events are lost and a single event with `.queueOverflow` is delivered instead. It has no path and a watch descriptor of `-1`; rescan the watched directories if you must not miss changes.
## Removing a Watch
Every `addWatch` variant returns one or more watch descriptors that you can use to remove the watch later: