Determine the number of characters waiting to be read
#include <termios.h> int tcischars( int filedes );
- A file descriptor that's associated with the device that you want to check.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The tcischars() function checks to see how many characters are waiting to be read from the given file descriptor, filedes.
The number of characters waiting to be read, or -1 if an error occurred.
- The fd argument isn't the file descriptor for a character device.