The terminal is mapped to the special file /dev/tty
, so all terminal I/O essentially involves I/O on the special file /dev/tty
. The size of the input and output buffers for /dev/tty
is 12,264 bytes, respectively. Only the control characters \n
(newline) and \t
(8-character tabulator) are converted.
The input of [EM][DÜ1] is interpreted as \n
(newline). The tab key does not generate the tab character \t
. Input from the terminal is buffered. If the buffer contains residual data, the maximum number of characters returned by a call to read()
will be restricted to the number of bytes contained in the buffer. It is only when the buffer is empty that the user is prompted for input from the terminal.
Input cannot be aborted with the [K2] key. It is only after all input has been read in from the terminal that the user can switch to system mode. In other words, users must press
[EM][DÜ1] once before they enter system mode.
On output, \n
generates a line feed, and \t
produces a tab. All other control characters are not converted; they are simply mapped as scribble characters. Output occurs at any of the following events:
a newline (
\n
) is encounteredthe buffer is full
on input from the terminal (terminated by [EM][DÜ1])
the program terminates