Hacker News new | past | comments | ask | show | jobs | submit login

I've been wondering about why there was no linux support, and found an e-mail from the author of the subcommand (as well as the github.blog post) explaining the situation.

Apparently an older implementation using inotify was dropped because inotify does not work recursively, so you would have to do an inotify call for all directories of the hierarchy which is obviously very inefficient. There are system wide limits in the number of directories you can listen to, and even if you increase the limit you would probably cause a lot of overhead.

Newer linuxes support the fanotify system call, which does allow recursive listening. They haven't implemented something using fanotify yet however.

https://lore.kernel.org/git/e1442a04-7c68-0a7a-6e95-304854ad...




Thanks, I didn't know about fanotify. Now I'm wondering why everything I use day-to-day (file syncing tools, IDEs, etc.) still seems to be stuck with inotify if there is a better option on modern operating systems. Maybe some of them are actually using fanotify under the hood, despite components still having "inotify" in their name.


TIL: fanotify was enabled in Linux 2.6.37 released 4 January, 2011

https://kernelnewbies.org/Linux_2_6_37#Enable_Fanotify_API


It needs 5.1 to be actually useful though:

https://man7.org/linux/man-pages/man7/fanotify.7.html

       In the original fanotify API,
       only a limited set of events was supported.  In particular, there
       was no support for create, delete, and move events.  The support
       for those events was added in Linux 5.1.  (See inotify(7) for
       details of an API that did notify those events pre Linux 5.1.)
https://www.phoronix.com/scan.php?page=news_item&px=Linux-5....

And https://lore.kernel.org/git/87czs1d6uy.fsf@evledraar.gmail.c... to link to fanotify discussion on the git mailing list (as well as some flaming about the feature not being supported on linux).


Ebpf should be possible to use on newer linuxes also I believe.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: