Re: How to tell how much to expect from a fd

Eric Lammerts
2002-03-28T13:28:19Z

On 27 Mar 2002, Mark Atwood wrote:

> Does there exist a fcntl or some other way to tell how much data is
> "ready to be read" from a fd?

int val;
ioctl(fd, FIONREAD, &val);

See tcp(7).

Eric