Skip to content
Advertisement

Tag: inotify

Are inotify event reads guaranteed not to be split across buffers?

All of the code examples for inotify do something like this: So presumably this allows for a single read() call to return up to 1024 events. What if there are actually more events than that in the queue? Will inotify guarantee to return a whole number of events, even if that means a short read? Or will inotify split an

How to stop the repetition of inotify result?

In this code, I am trying to monitor two paths at the same time. I used while(1) for this purpose. But the problem that I am facing is that whenever I run the code, it gives me the same result two times like this. Giving result Expected result I debugged the code. After breaking the main function and stepping over

inotify_add_watch relative to O_PATH dirfd

I am trying to call inotify_add_watch to watch a file. I would like to specify the file relative to an O_PATH | O_DIRECTORY file descriptor, a la symlinkat, fstatat, or openat. Is this possible? It doesn’t look like it is. Anyone know of a workaround? EDIT The closest thing seems to be the “trick” described at man 2 open under

Advertisement