|
|
Subscribe / Log in / New account

Another new ABI for fanotify

Another new ABI for fanotify

Posted Nov 12, 2009 3:57 UTC (Thu) by mezcalero (subscriber, #45103)
Parent article: Another new ABI for fanotify

I hope fanotify fixes one things that is really missing in the inotify API: some way to identify if some event was triggered by the process that is listening.

i.e. what inotify currently sucks at is to use it for reading files or devices nodes that have just been closed. i.e. a loop such as "for (;;) { wait_until_someone_closes_a_file_after_writing(); check_what_changed(); }", since the check_what_changed() call might itself open() and close() the file/device node, one would enter a loop here which is very hard to break, since one cannot distuingish between events that were triggered by the process itself or by someone else. An easy fix this could be to include the PID of the process that triggered an event. That way programs could simply ignore all events triggered by themselves.


to post comments

Another new ABI for fanotify

Posted Nov 12, 2009 15:18 UTC (Thu) by eparis (guest, #33060) [Link]

Pid is included in later patches.

Also you have an open fd which will not cause you to get events. So you can just operate on that fd and you won't hit the loop, open files yourself and you will get events for it.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds