Hello,
I am using inotify with "interupt io" by setting the O_ASYNC flag on the inotify file descriptor and then using fcntl(inotifyfd, F_SETOWN, getpid()) coupled with a signal(sighandler, SIGIO) call, all from a single process, in order to set up an inotify file descriptor event handler.
The idea is to have inotify's file descriptor generate the SIGIO signal (via the O_ASYNC flag set) and have teh signal(..) registered handler handle the SIGIO signals as they are emitted thus avoiding polling the inotify file descriptor.
After the initial setup and signal handler setting the process has nothing to do and would normally exit.
I need the same process to remain idle after the setup as it acts as a daemon awaiting the SIGIO signals. This is where I am looking for help.
How can I idle the process to take the very least amount of cpu resources?
Steve