Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/t/tcflush.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/t/tcflush.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/t/tcflush.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/t/tcflush.html on line 8
Flush the input and/or output stream
#include <termios.h>
int tcflush( int fildes,
int queue_selector );
- fildes
- A file descriptor that's associated with the data stream that you want to
perform the operation on.
- queue_selector
- The stream or streams that you want to flush.
At least the following values for
queue_selector are defined in <termios.h>:
- TCIFLUSH — discard all data that's received,
but not yet read, on the device associated with fildes.
- TCOFLUSH —
discard all data that's written, but not yet transmitted, on
the device associated with fildes.
- TCIOFLUSH —
discard all data that's written, but not yet transmitted,
as well as all data that's received, but not yet read, on
the device associated with fildes.
libc
Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.
The tcflush() function flushes the input stream, the output
stream, or both, depending on the value of the argument
queue_selector.
- 0
- Success.
- -1
- An error occurred
(errno is set).
- EBADF
- Invalid fildes argument.
- EINVAL
- Invalid queue_selector argument.
- ENOSYS
- The resource manager associated with fildes doesn't support
this call.
- ENOTTY
- The argument fildes doesn't refer to a terminal device.
#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;
}
POSIX 1003.1
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
Yes |
Thread |
Yes |
tcdrain(),
tcflow(),
tcsendbreak()
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/t/tcflush.html on line 198
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/t/tcflush.html on line 198