Check to see if a read is likely to succeed
#include <unix.h> int rdchk( int fd );
- The file descriptor that you want to check.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The rdchk() function checks to see if a read from the file descriptor, fd, is likely to succeed.
The number of characters waiting to be read, or -1 if an error occurred (errno is set).
- The fd argument isn't the file descriptor for a character device.