On Wed, Feb 4, 2015 at 10:10 PM, Richard A. O'Keefe <ok@cs.otago.ac.nz> wrote:
Given things like sockets, STREAMS, and ptys, I am not
sure that it is _possible_ for a Unix system to determine whether two streams
are or are not "related" reliably.

It's not. I was not implying that it was, or that it was even a good idea to try to do so. On the other hand, flushing *every* line-buffered FILE is rather overkill but less heinous than highly dubious and untestable assumptions about relationships.

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b@gmail.com                                  ballbery@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net