Open System Services System Calls Reference Manual (G06.25+, H06.03+)
tty(7) OSS System Calls Reference Manual
process group. With the setpgid() function, other processes can be added to a process group.
A controlling terminal can have a process group associated with it that is known as the fore-
ground process group. The terminal’s foreground process group is the one that receives signals
generated by the VINTR, VQUIT, and VSUSP special control characters. Certain operations on
the terminal are also restricted to processes in the terminal’s foreground process group (see Ter-
minal Access Control, later in this reference page). A terminal’s foreground process group can
be changed by calling the tcsetpgrp() function. A terminal’s current foreground process group
can be obtained by calling the tcgetpgrp() function.
Input Processing Modes
The terminal drivers have two major modes, characterized by the kind of processing that takes
place on the input characters:
Canonical If a terminal is in canonical mode, input is collected and processed one line at a
time. Lines are terminated by a newline (\*L0), End-of-File (VEOF), or End-
of-Line (EOL) character. A read request is not returned until either the line is
terminated or a signal is received. The maximum number of bytes of unread
input allowed on an input terminal is 255 bytes.
Erase and kill processing is performed on input that was not terminated by one of
the line-termination characters. Erase processing removes the last character in
the line; kill processing removes the whole line.
Noncanonical Noncanonical mode eliminates erase and kill processing, making input charac-
ters available to the user program as they are typed. Input is not processed into
lines. The received bytes are processed according to the VMIN and VTIME
elements of the c_cc array in the termios structure.
VMIN The minimum number of bytes the terminal can receive in non-
canonical mode before a read is considered successful.
VTIME Measured in 0.1-second units, times out sporadic input.
These cases are summarized as follows:
VMIN>0, VTIME>0
In this case, VTIME is an interbyte timer that is activated after
the first byte of the input line is received and reset after each
byte is received. The read operation is a success if VMIN bytes
are read before VTIME runs out. If VTIME runs out before
VMIN bytes are received, the characters that were received are
returned.
VMIN>0, VTIME=0
In this case, only VMIN is used. A queued read() function call
waits until either VMIN bytes are received or a signal is
received.
VMIN=0, VTIME>0
In this case, VTIME is used as a read timer that starts when a
read() function call is made. The read() call is finished either
when one byte is read or when VTIME runs out.
11−58 Hewlett-Packard Company 527186-003