Thanks to both of you for working through the details on this. This does
seem like a useful feature, and would be appropriate to add.
A summarized patch set would be appreciated at this stage, thanks.
Re HAVE_INOTIFY, that's really a proxy for a linux kernel, and so would
be most appropriately changed to:
defined __linux__ || defined __ANDROID__
I'm thinking these hardcoded defines would be best for now at least as
it covers the vast majority of systems, and avoids complicated (cross)
compile time checks.
A modularised iopoll.c would be better, given the potential uses by
other tools, though we'd probably release for just tee initially.
As for interface to this functionality I'm wondering if we could just
have the existing tee {-p,--output-error} imply the use of poll() on
output.
I.e. from a high level -p just means to deal more appropriately with non
file outputs, and as part of that, dealing immediately with closed
outputs would be an improvement.
Note also tail(1) enables this functionality by default. I'm not sure
about other utilities, but we can deal with that later if needed.