Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
OSS Library Calls (t - v) tcflush(3)
NAME
tcflush - Flushes untransmitted output data or unread input data
LIBRARY
G-series native OSS processes: system library
H-series and J-series OSS processes: implicit libraries
SYNOPSIS
#include <termios.h>
int tcflush(
int filedes,
int queue_selector);
PARAMETERS
filedes Specifies an open file descriptor associated with a terminal.
queue_selector Specifies one of the following actions:
TCIFLUSH Flushes data received but not read.
TCIOFLUSH Flushes both data received but not read and data written but not
transmitted.
TCOFLUSH Flushes data written but not transmitted.
DESCRIPTION
The tcflush( ) function discards any data written but not transmitted to the object referred to by
the filedes parameter, or data received but not read by the object referred to by filedes, depending
on the value of the queue_selector parameter.
An attempt to use the tcflush( ) function from a process that is a member of a background process
group on a filedes associated with its controlling terminal causes the process group to be sent a
SIGTTOU signal. If the calling process is blocking or ignoring the SIGTTOU signal, the pro-
cess is allowed to perform the operation and no signal is sent.
RETURN VALUES
Upon successful completion, the value 0 (zero) is returned. Otherwise, the value -1 is returned
and errno is set to indicate the error.
ERRORS
If any of the following conditions occurs, the tcflush( ) function sets errno to the corresponding
value:
[EBADF] The filedes parameter does not specify a valid file descriptor.
[EINVAL] The queue_selector parameter does not specify a proper value.
[EIO] One of the following conditions exists:
• The process group of the caller is orphaned and the caller is not ignoring
or blocking the SIGTTOU signal.
• An input/or output error occurred. The device holding the terminal file
might be in the down state, or both processors that provide access to the
device might have failed.
527187-017 Hewlett-Packard Company 7−13