tcdrain(3C) tcdrain(3C)
NAME
tcdrain, tcflow, tcflush, tcsendbreak - Perform terminal
line control operations.
SYNOPSIS
#include <termios.h>
int tcdrain (fildes)
int fildes;
int tcflow (fildes, action)
int fildes;
int action;
int tcflush (fildes, queueselector)
int fildes;
int queueselector;
int tcsendbreak (fildes, duration)
int fildes;
int duration;
DESCRIPTION
The tcdrain(), tcflow(), tcflush(), and tcsendbreak() func-
tions are defined in the POSIX 1003.1 standard and used in
the OCS and BCS standards. CX/UX applications which are not
POSIX/OCS/BCS compliant can use these functions.
Background processes may not call these functions. Attempts
to do so will result in a SIGTTOU signal being sent to the
calling process and all members of its process group. The
SIGTTOU signal stops the calling process and all members of
its process group unless the calling process is blocking or
ignoring this signal.
tcdrain waits until all output written to the terminal dev-
ice referenced by fildes has been transmitted (drained).
Tcflow suspends transmission or reception of data to the
terminal device referenced by fildes. depending upon the
value of action as follows:
TCOOFF
Suspend output.
TCOON
Restart suspended output.
TCIOFF
Transmit a STOP character, to cause the terminal
to stop transmitting data to the system.
Page 1 CX/UX Programmer's Reference Manual
tcdrain(3C) tcdrain(3C)
TCION
Transmit a START character, to cause the terminal
to start transmitting data to the system.
The action constants are defined in <termios.h>.
Tcflush discards (flushes) data associated with the terminal
device referred to by fildes. The data may be written but
not transmitted or received but not read. The method used
depends upon the value of queue_selector:
TCIFLUSH
Data received, but not read is flushed.
TCOFLUSH
Data written, but not transmitted is flushed.
TCIOFLUSH
Data received, but not read, and data written, but
not transmitted is flushed.
The queue_selector constants are defined in <termios.h>.
Tcsendbreak causes the transmission of a continuous stream
of zero-valued bits (break) for a specified duration when
using asynchronous serial data transmission on the terminal
device referred to by fildes. For CX/UX, the value of dura-
tion should always be zero, because the system only supports
transmission of a continuous stream of zero bits for 0.25
second. All other values of duration will be ignored and
only transmit for 0.25 second.
SEE ALSO
termios(7)
DIAGNOSTICS
Upon successful completion, a value of zero is returned by
all functions. If not, a value of -1 is returned and errno
is set.
Errno is set to one of the following values for tcdrain:
[EBADF] Fildes is not a valid open file descriptor.
[EINTR] A signal interrupted the function.
Errno is set to one of the following values for tcflow:
[EBADF] Fildes is not a valid open file descriptor.
[EINVAL] The action argument is not a proper value as
defined in <termios.h>.
Page 2 CX/UX Programmer's Reference Manual
tcdrain(3C) tcdrain(3C)
[ENOTTY] Fildes is not associated with a terminal dev-
ice.
Errno is set to one of the following values for tcflush:
[EBADF] Fildes is not a valid open file descriptor.
[EINVAL] The queue_selector argument is not a proper
value as defined in <termios.h>.
[ENOTTY] Fildes is not associated with a terminal dev-
ice.
Errno is set to one of the following values for tcsendbreak:
[EBADF] Fildes is not a valid open file descriptor.
[ENOTTY] Fildes is not associated with a terminal dev-
ice.
Page 3 CX/UX Programmer's Reference Manual