GNU bug report logs -
#21265
tail -f: inotify being used on non-regular files
Previous Next
Full log
Message #11 received at 21265 <at> debbugs.gnu.org (full text, mbox):
2015-08-26 03:13:59 +0100, Pádraig Brady:
[...]
> I notice both with and without inotify
> there is a similar issue (for different reasons)
> when multiple devices are specified:
>
> tail ---dis -f /dev/tty /dev/tty
>
> I.E. we generally can't deal with this case in either case,
> though it probably makes sense in any case to avoid inotify
> for device nodes?
>
> BTW, in the inotify case, theoretically the kernel should be returning
> an error if the watch events are not supported?
>
> The same argument applies that the kernel should return
> and error when adding a watch on pseudo file systems like /proc?
> To work around that, we'd have to get real kludgy and see
> were the files on a "dummy" file system or something.
> Though tail -f /proc files in either mode is not that useful,
> so probably not worrying about that case.
[...]
All very good points.
Many files in /proc, /sys... can only be read reliably in one read()
operation anyway, and doing tail -f on them would give you
garbage even if it worked.
I guess the best approach would be to only use inotify for
regular files, address blocking files (pipe, devices...) when
several files are being watched with poll() and/or non-blocking
IO, or alarm()/timers or threads, and document the other issues.
Or not do anything and just document those limitations as they
are mostly edge cases.
--
Stephane
This bug report was last modified 6 years and 272 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.