Open System Services Library Calls Reference Manual (G06.28+, H06.05+)

OSS Library Calls (t - v) tc
ush(3)
NAME
tcush - Flushes untransmitted output data or unread input data
LIBRARY
G-series native OSS processes: system library
H-series OSS processes: implicit libraries
SYNOPSIS
#include <termios.h>
int tcush(
int ledes,
int queue_selector);
PARAMETERS
filedes Species an open le descriptor associated with a terminal.
queue_selector Species 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 tcush( ) function discards any data written but not transmitted to the object referred to by
the ledes parameter, or data received but not read by the object referred to by ledes, depending
on the value of the queue_selector parameter.
An attempt to use the tcush() function from a process that is a member of a background process
group on a ledes 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 tcush() function sets errno to the corresponding
value:
[EBADF] The ledes parameter does not specify a valid le 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 le
might be in the down state, or both processors that provide access to the
device might have failed.
527187-007 Hewlett-Packard Company 79