25.1 flushtty (8252)

The purpose of this procedure is to “normalise” the queries associated with a particular terminal. Its effect is to terminate transmission to the terminal forthwith and to throw away any accumulated input characters.

8258:

Throw away everything in the “cooked” input queue;

8259:

ditto for the output queue;

8260:

Wakeup any process waiting to extract a character from the “raw” input queue;

8261:

ditto for the output queue;

8263:

Raise the processor priority to prevent an interrupt from the terminal while ...

8264:

the “raw” input queue is flushed,

8265:

the “delimiter count” is properly set to zero.

“flushtty” is called by “wflushtty” (see below) and “ttyinput” (8346, 8350) when either:

(a)

the terminal is not operating in “raw” mode and a “quit” or “delete” character is received from the terminal; or

(b)

the “raw” input queue has grown unreasonably large (presumably because no process is reading input from the terminal);