Node:Line Control, Next:Noncanon Example, Previous:BSD Terminal Modes, Up:Low-Level Terminal Interface
These functions perform miscellaneous control actions on terminal
devices. As regards terminal access, they are treated like doing
output: if any of these functions is used by a background process on its
controlling terminal, normally all processes in the process group are
sent a SIGTTOU
signal. The exception is if the calling process
itself is ignoring or blocking SIGTTOU
signals, in which case the
operation is performed and no signal is sent. See Job Control.
int tcsendbreak (int filedes, int duration) | Function |
This function generates a break condition by transmitting a stream of
zero bits on the terminal associated with the file descriptor
filedes. The duration of the break is controlled by the
duration argument. If zero, the duration is between 0.25 and 0.5
seconds. The meaning of a nonzero value depends on the operating system.
This function does nothing if the terminal is not an asynchronous serial data port. The return value is normally zero. In the event of an error, a value
of -1 is returned. The following
|
int tcdrain (int filedes) | Function |
The tcdrain function waits until all queued
output to the terminal filedes has been transmitted.
This function is a cancellation point in multi-threaded programs. This
is a problem if the thread allocates some resources (like memory, file
descriptors, semaphores or whatever) at the time The return value is normally zero. In the event of an error, a value
of -1 is returned. The following
|
int tcflush (int filedes, int queue) | Function |
The tcflush function is used to clear the input and/or output
queues associated with the terminal file filedes. The queue
argument specifies which queue(s) to clear, and can be one of the
following values:
The return value is normally zero. In the event of an error, a value
of -1 is returned. The following
It is unfortunate that this function is named |
int tcflow (int filedes, int action) | Function |
The tcflow function is used to perform operations relating to
XON/XOFF flow control on the terminal file specified by filedes.
The action argument specifies what operation to perform, and can be one of the following values:
For more information about the STOP and START characters, see Special Characters. The return value is normally zero. In the event of an error, a value
of -1 is returned. The following
|