Subject: Re: read() and select()
To: None <mcuddy@fensende.com>
From: Bill Sommerfeld <sommerfeld@orchard.arlington.ma.us>
List: tech-userlevel
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, 

	int count;
	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.

					- Bill