Subject: Re: read() and select()
To: None <firstname.lastname@example.org>
From: Bill Sommerfeld <email@example.com>
Date: 11/17/2000 16:14:54
> Is there any way to detect the difference between the child exiting and there
> actually being data to read?
The FIONREAD ioctl might give you the clue you're looking for.
For drivers which implement it,
ioctl(fd, FIONREAD, &count);
returns the number of bytes of un-read data in "count". this is
implemented for sockets, and pipes are implemented as sockets "under
the hood" so this should just work.