GNU Info

Info Node: (libc.info)I/O Queues

(libc.info)I/O Queues


Next: Canonical or Not Prev: Is It a Terminal Up: Low-Level Terminal Interface
Enter node , (file) or (file)node

I/O Queues
==========

   Many of the remaining functions in this section refer to the input
and output queues of a terminal device.  These queues implement a form
of buffering _within the kernel_ independent of the buffering
implemented by I/O streams (Note: I/O on Streams).

   The "terminal input queue" is also sometimes referred to as its
"typeahead buffer".  It holds the characters that have been received
from the terminal but not yet read by any process.

   The size of the input queue is described by the `MAX_INPUT' and
`_POSIX_MAX_INPUT' parameters; see Note: Limits for Files.  You are
guaranteed a queue size of at least `MAX_INPUT', but the queue might be
larger, and might even dynamically change size.  If input flow control
is enabled by setting the `IXOFF' input mode bit (Note: Input Modes),
the terminal driver transmits STOP and START characters to the terminal
when necessary to prevent the queue from overflowing.  Otherwise, input
may be lost if it comes in too fast from the terminal.  In canonical
mode, all input stays in the queue until a newline character is
received, so the terminal input queue can fill up when you type a very
long line.  Note: Canonical or Not.

   The "terminal output queue" is like the input queue, but for output;
it contains characters that have been written by processes, but not yet
transmitted to the terminal.  If output flow control is enabled by
setting the `IXON' input mode bit (Note: Input Modes), the terminal
driver obeys START and STOP characters sent by the terminal to stop and
restart transmission of output.

   "Clearing" the terminal input queue means discarding any characters
that have been received but not yet read.  Similarly, clearing the
terminal output queue means discarding any characters that have been
written but not yet transmitted.


automatically generated by info2www version 1.2.2.9