Giuseppe Scrivano <gscriv...@gnu.org> writes:

> In my opinion, it is desiderable that tail works approximately in the
> same way when stdin is specified,

Assuming that the extension you proposed in
<http://www.mail-archive.com/bug-coreutils@gnu.org/msg17684.html> is
added to the Linux kernel, I suggest that coreutils modify the code to
use 'inotify_add_watch_fd' instead of the current 'inotify_add_watch'.
This will let "tail" watch stdin just like it can watch any other file
descriptor.

An added benefit of the fd approach is that it will fix a race
condition in the current code, if a file is renamed between the call
to 'open' and the call to 'inotify_add_watch_fd'.

It should also simplify the "tail" code considerably to use an
file-descriptor-based approach.

In the meantime I would just leave the code alone; no sense wasting
much time maintaining the inferior kernel interface.


Reply via email to