Flush the input and/or output stream
#include <termios.h>
int tcflush( int fildes,
int queue_selector );
libc
The tcflush() function flushes the input stream, the output stream, or both, depending on the value of the argument queue_selector. At least the following values for queue_selector are defined in <termios.h>:
#include <termios.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
int main( void )
{
int fildes;
fildes = open( "/dev/ser1", O_RDWR );
/* Throw away all input data */
tcflush( fildes, TCIFLUSH );
close( fildes );
return EXIT_SUCCESS;
}
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | No |
| Signal handler | Yes |
| Thread | Yes |
errno, tcdrain(), tcflow(), tcsendbreak()