Correct or inotify: pick one
wingolog.org
wingolog.org
In the end, I came to the same conclusion as the author: while inotify is much better than dnotify (and relatively better than misconceived interfaces like epoll(2)), its flaws remain serious and it would be frustrating to write a correct application based upon it.
Fixing this would entail letting go of one of the architectural concepts of the system, either that a filter+ident pair uniquely identifies an event in a queue or that a process only ever has one event queue. (Letting go of the latter also entails a further mechanism for polling multiple event queues.)
The reason EVFILT_VNODE works where inotify doesn't is precisely because EVFILT_VNODE requires an open file descriptor, which indirectly behaves as a preallocated buffer for storing pending events. But just like with signals, like events are coalesced and ordering can be lost.
I think the most straight-forward solution to fork notifications is to block the forking process if the event can't be enqueued. That might be the only proper solution, period, if you want guaranteed delivery with the new PID. That creates the potential for deadlocking, but that already exists with other facilities like file locking, pipes, etc.
[1] https://www.gnu.org/prep/standards/standards.html#index-arbi...
I assume it hasn't changed too much in the past decade?
> The FSEvents framework relies on a single, constantly running daemon process called fseventsd that reads from /dev/fsevents and writes the events to log files on disk (stored in a .fseventsd directory at the root of the volume the events are for). That's it.
> "The FSEvents framework, in turn, can only tell its clients, "Something has changed in directory /foo/bar/baz."
> Clients of FSEvents are expected to then scan the directory that has changed in order to determine what, exactly, happened (assuming they're interested in that level of detail)."
If there was no use for this outside of Apples own apps they wouldn’t have given it a public api.