inotify EINTR, or not

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Version 5.00 (http://man7.org/linux/man-pages/man7/inotify.7.html)

>If no events have so far occurred,
then, assuming a blocking file descriptor, read(2) will block until
at least one event occurs (unless interrupted by a signal, in which
case the call fails with the error EINTR; see signal(7)).

but https://bugzilla.kernel.org/show_bug.cgi?id=195711 says that since
3.8 the call is restarted, which is also my experience (and huge
annoyance). However, I am not on the latest Kernel but 4.9.0-8-amd64
so I dont know if it has been changed back. A cursory search over the
kernel code says that last change with inotify and EINTR in same
context was removing EINTR and replacing with ERESTARTSYS
(https://github.com/torvalds/linux/commit/1ca39ab9d21ac93f94b9e3eb364ea9a5cf2aba06).

There really should be caveat that the syscall is probably restarted
when reading from an inotify file-descriptor. This has important
implications on how one can use the interface (ie simple blocking
style is absolutely not enough and some multiplexing is always
required for reliable execution even in simple programs).

Emil Fihlman



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux