I would like to know if fd has data to read. I tried ioctl with FIONREAD , but this results in a "Operation without support" error. Any ideas?
ioctl
FIONREAD
You can use select() with a null (not NULL ) timeout.
select()
NULL
Use poll() or select() in the file descriptor.
poll()