Open System Services System Calls Reference Manual (G06.25+, H06.03+)

Files tty(7)
Input Echoing and Redisplay
The terminal driver has several modes for handling the echoing of terminal input, controlled by
bits in the c_lag eld of the termios structure.
Erasing Characters From a CRT
When a CRT terminal is in use, the ECHOE bit of the c_lag eld of the termios structure can
be set to cause input to be erased from the screen with a backsp
ace-space-backspace sequence
when character-deleting or word-deleting sequences are used.
Output Processing
When one or more characters are written, they are actually transmitted to the terminal as soon as
previously written characters have nished typing. Input characters are normally echoed by put-
ting them in the output queue as they arrive. When a process produces characters more rapidly
than the terminal can accept them, it is suspended when its output queue exceeds some limit.
When the queue has come down to some threshold, the program resumes.
Line Control and Breaks
The tcsendbreak() function can cause a break condition for a specied amount of time. Break
conditions in the input are handled according to the value in the c_iag eld of the termios
structure. (Refer to Input Modes, earlier, for a complete list of the c_iag eld settings.)
When a TELNET disconnect is detected, all OSS open le descriptors are cleared if the terminal
window is a dynamic window or a static window with CLOCAL not set in the c_cag eld of
the termios structure. All outstanding write requests fail with the error [EIO]. All outstanding
read requests return zero bytes read. If CLOCAL is set on a static window, outstanding read and
write requests are queued until a new TELNET connection is established. If CLOCAL is not set
and a static window is a controlling terminal, a SIGHUP signal is sent to the windows control-
ling process.
Interrupt Characters
When ISIG is set in the c_lag word of termios, there are several characters that generate sig-
nals in both canonical and noncanonical mode; all are sent to the processes in the foreground
process group of the terminal. If NOFLSH is not set in c_lag, these characters also ush pend-
ing input and output when typed at a terminal. The characters shown here are the default charac-
ters; the symbolic names of the indexes of these characters in the c_cc array of termios are also
shown. The characters are as follows:
^C VINTR (in c_cc) generates a SIGINT signal. This is the normal way to stop a
process or to regain control in an interactive program.
^\ VQUIT (in c_cc) generates a SIGQUIT signal. This causes a program to ter-
minate and produce a saveabend le, if possible, in the current directory.
^Z VSUSP (in c_cc) generates a SIGTSTP signal, which is used to suspend the
current process group.
Terminal Access Control
If a process attempts to read from its controlling terminal when the process is not in the fore-
ground process group of the terminal, that background process group is sent a SIGTTIN signal,
the read returns a -1, and errno is set to [EINTR]. This signal normally causes the members of
that process group to stop. If, however, the process is ignoring SIGTTIN or has SIGTTIN
blocked, or if the reading processs process group is orphaned, the read returns the value -1 with
errno set to [EIO] and does not send a signal.
If a process attempts to write to its controlling terminal when the process is not in the foreground
process group of the terminal, and if TOSTOP is set in the c_lag word of the termios structure,
the background process group is sent a SIGTTOU signal and the process is prohibited from writ-
ing. If TOSTOP is not set, or if TOSTOP is set and the process is blocking or ignoring the
527186-003 Hewlett-Packard Company 1161