termio.7 (2010 09)

t
termio(7) termio(7)
The special characters are assigned their default character values when the terminal port is opened. The
default values used are those specified by the System V Interface Definition, Third Edition (SVID3),
except for the WERASE (Control-W) and LNEXT (Control-V) characters which are set to
_POSIX_VDISABLE
to maintain binary compatibility with previous releases of HP-UX. The default
character values assigned when the port is opened can be changed for all ports on a system wide basis
through the use of the
stty command (see stty (1)). The character values may also be changed for a
specific port after it is opened using the
stty command. The NL and CR characters cannot be changed
or disabled. The character values for the remaining special characters can be changed or disabled to suit
individual tastes.
If
ICANON is set (see Local Modes), the ERASE, KILL, and EOF characters can be escaped by a preced-
ing \ character, in which case no special function is performed. These characters, and the remaining
special characters, may also be escaped by preceding them with the LNEXT character (see LNEXT
above).
If two or more special characters have the same value, the function performed when the character is pro-
cessed is undefined.
Modem Disconnect
If a modem disconnect is detected by the terminal interface for a controlling terminal, and if
CLOCAL is
clear in the
c_cflag field for the terminal (see Control Modes), the
SIGHUP signal is sent to the con-
trolling process of the controlling terminal. Unless other arrangements have been made, this causes the
controlling process to terminate. Any subsequent read from the terminal device returns with an end-of-
file indication until the device is closed. Thus, processes that read a terminal file and test for end-of-file
can terminate appropriately after a disconnect. Any subsequent
write() to the terminal device
returns −1, with
errno set to EIO, until the device is closed.
Closing a Terminal Device File
The last process to close a terminal device file causes any output not already sent to the device to be sent
to the device even if output was suspended. This last close always blocks (even if non-blocking I/O has
been specified) until all output has been sent to the terminal device. Any input that has been received
but not read is discarded.
Writing Data and Output Processing
When characters are written, they are placed on the output queue. Characters on the output queue are
transmitted to the terminal as soon as previously-written characters are sent. These characters are pro-
cessed according to the
c_oflag field (see Output Modes ). Input characters are echoed by putting them
in the output queue as they arrive. If a process produces characters for output more rapidly than they
can be sent, the process is suspended when its output queue exceeds some limit. When the queue has
drained down to some threshold, the process is resumed.
termios Structure
Routines that need to control certain terminal I/O characteristics can do so by using the
termios struc-
ture as defined in the header file
<termios.h>. The structure is defined as follows:
#define NCCS 16
struct termios {
tcflag_t c_iflag; /* input modes */
tcflag_t c_oflag; /* output modes */
tcflag_t c_cflag; /* control modes */
tcflag_t c_lflag; /* local modes */
tcflag_t c_reserved; /* reserved for future use */
cc_t c_cc[NCCS]; /* control chars */
};
The special characters are defined by the array
c_cc. The relative positions and default values for each
special character function are as follows:
INTR VINTR DEL
QUIT VQUIT Control-|
6 Hewlett-Packard Company − 6 − HP-UX 11i Version 3: September 2010