This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* If you want to see which inotify watches are being created by an application then you can | |
* use this simple piece of code, compile it to a shared library and LD_PRELOAD it when starting | |
* the application. Keep an eye on syslog to see the list of watches. | |
* **NOTE**: this only logs the watches, it won't actually create the watch and thus watching | |
* for changes WON'T actually WORK! | |
* | |
* More details (adjust as needed for your environment/distribution): | |
* - Save this file in e.g. $HOME/inotify.c | |
* - Compile: gcc -shared -o inotify.so inotify.c |