e-dant / watcher

Filesystem watcher. Works anywhere. Simple, efficient and friendly.
MIT License
639 stars 32 forks source link

Please provide a way to disable fanotify #27

Closed toge closed 1 year ago

toge commented 1 year ago

I am excited with the 0.5.3 version upgrade that wraps not only inotify but also fanotify.

On the other hand, fanotify is a relatively new feature that will not compile on slightly older kernels. The 0.5.3 implementation of fanotify uses FAN_REPORT_DFID_NAME, so it seems to require Kernel 5.9 or later to compile. https://man7.org/linux/man-pages/man2/fanotify_init.2.html

Is it possible to add the following condition for include/watcher/adapter/linux/watch.hpp and include/watcher/adapter/linux/fanotify/watch.hpp?

e-dant commented 1 year ago

Thank you very much for your work and attention. I'm sure there's a way to do this. I'll take a look after work.

e-dant commented 1 year ago

Latest release should fix this. I'm happy to keep this issue open in case there are any other portability bugs that crop up.

toge commented 1 year ago

@e-dant Thanks a lot! It works well for me.