The c_iflag
field describes the basic terminal input control:
Mask name | Definition |
| Send |
| Map |
| Ignore |
| Ignore |
| Ignore characters with parity errors |
| Map |
| Enable input parity check |
| Strip 8th bit of input character |
| Enable |
| Enable |
| Mark parity errors |
Will no longer be supported by | Map uppercase to lowercase on input |
| Enable any input character to restart output |
In the context of asynchronous serial transmission via a serial interface, a break
is defined as a sequence of zero-valued bits that continues for more than the time required to send one byte. The entire sequence of zero-valued bits is interpreted as a single break
, even if the sequence comprises more than one byte. In contexts other than asynchronous serial data transmission, the meaning of a break
condition is not defined.
If IGNBRK
is set, any break
that occurs on input will be ignored, i.e. not placed in the input queue and therefore not read by any process. On the other hand, if BRKINT
is set, the break condition generates a single interrupt signal SIGINT
and flushes both the input and output queues. If neither IGNBRK
nor BRKINT
is set, a break
condition is read as a single \0
character, or if PARMRK
is set, as \377
, \0
, \0
.
If IGNPAR
is set, any byte with a character or parity error (other than break
) is ignored.
If PARMRK
is set, and IGNPAR
is not set, any byte with a framing or parity error (other than break
) is passed to the application as the three-character sequence \377
, \0
and X
, where \377
and \0
constitute a two-byte flag preceding each sequence and X
corresponds to the character received in error. To avoid ambiguity in this case, if ISTRIP
is not set, a valid character of \377
is passed to the application as \377
, \377
. If neither PARMRK
nor IGNPAR
is set, a framing or parity error (other than break
) is passed to the application as a single
If INPCK
is set, input parity checking is enabled. If INPCK
is not set, input parity checking is disabled, allowing generation of the output parity bit without heeding any input parity errors that may have occurred.
Note
The enabling or disabling of input parity checking is independent of whether parity detection is enabled or disabled (see section “Control modes”). If parity detection is enabled but input parity checking is disabled, the hardware to which the terminal is connected will recognize the parity bit, but the terminal special file will not check whether or not this bit is correctly set.
If INLCR
is set, a received NL
character (newline) is translated into a CR
character (carriage return). If IGNCR
is set, a received CR
character is ignored (not read). However, if IGNCR
is not set and ICRNL
is set, a received CR
character is converted into an NL
character.
If IUCLC
is set, a received uppercase letter is mapped to the corresponding lowercase letter (Will no longer be supported by the X/Open-Standard in future.).
If IXON
is set, START/STOP
output control is enabled. A received STOP
character suspends output, and a received START
character restarts output. The control characters for START
and STOP
are not read during a read operation, however, they perform flow control functions when IXON
is set. When IXON
is not set, the START
and STOP
characters are read. If IXANY
is set, the suspended output is resumed as soon as any character is entered.
If IXOFF
is set, START/STOP
input flow control is enabled. The system transmits STOP
characters in order to cause the terminal device to stop transmitting data as needed to prevent an overflow in the input queue (no more than {MAX_INPUT}
bytes are permitted). It transmits START
characters to cause the terminal device to resume transmitting data, as soon as the device can continue doing so without any risk of overflowing the input queue.
The initial value for all input modes after an open()
is that no flag is set.