This section describes the terminal attribute flags that control fairly low-level aspects of input processing: handling of parity errors, break signals, flow control, and RET and LFD characters.
All of these flags are bits in the
c_iflag member of the
struct termios structure. The member is an integer, and you
change flags using the operators
try to specify the entire value for
only specific flags and leave the rest untouched (see section Setting Terminal Modes Properly).
Parity checking on input processing is independent of whether parity
detection and generation on the underlying terminal hardware is enabled;
see section Control Modes. For example, you could clear the
input mode flag and set the
PARENB control mode flag to ignore
parity errors on input, but still generate parity on output.
If this bit is set, what happens when a parity error is detected depends
on whether the
PARMRK bits are set. If neither
of these bits are set, a byte with a parity error is passed to the
application as a
INPCKis also set.
INPCKis set and
IGNPARis not set.
The way erroneous bytes are marked is with two preceding bytes,
0. Thus, the program actually reads three bytes
for one erroneous byte received from the terminal.
If a valid byte has the value
ISTRIP (see below)
is not set, the program might confuse it with the prefix that marks a
parity error. So a valid byte
0377 is passed to the program as
0377, in this case.
A break condition is defined in the context of asynchronous serial data transmission as a series of zero-value bits longer than a single byte.
IGNBRKis not set, a break condition clears the terminal input and output queues and raises a
SIGINTsignal for the foreground process group associated with the terminal.
IGNBRK are set, a break condition is
passed to the application as a single
'\0' character if
PARMRK is not set, or otherwise as a three-character sequence
'\r') are discarded on input. Discarding carriage return may be useful on terminals that send both carriage return and linefeed when you type the RET key.
IGNCRis not set, carriage return characters (
'\r') received as input are passed to the application as newline characters (
'\n') received as input are passed to the application as carriage return characters (
This is a BSD extension; it exists only on BSD systems and the GNU system.
007) to the terminal to ring the bell.
This is a BSD extension.
Go to the first, previous, next, last section, table of contents.