tags:

views:

81

answers:

2

I'd like to know if a fd has data available for reading. I have tried ioctl with FIONREAD but that results in a "Operation not supported error". Any ideas?

+4  A: 

You can use select(), with a zero (not NULL) timeout.

unwind
Thanks that works fine.
StackedCrooked
A: 

Use poll() or select() on your file descriptor.

bltxd