Values of the
c_iflag field describe the basic terminal input control, and are composed of following masks:
IGNBRK
/* ignore BREAK condition */
BRKINT
/* map BREAK to SIGINT */
IGNPAR
/* ignore (discard) parity errors */
PARMRK
/* mark parity and framing errors */
INPCK
/* enable checking of parity errors */
ISTRIP
/* strip 8th bit off chars */
INLCR
/* map NL into CR */
ICRNL
/* map CR to NL (ala CRMOD) */
IXON
/* enable output flow control */
IXOFF
/* enable input flow control */
IXANY
/* any char will restart after stop */
IMAXBEL
/* ring bell on input queue full */
In the context of asynchronous serial data transmission, a break condition is defined as a sequence of zero-valued bits that continues for more than the time to send one byte. The entire sequence of zero-valued bits is interpreted as a single break condition, even if it continues for a time equivalent to more than one byte. In contexts other than asynchronous serial data transmission the definition of a break condition is implementation defined.
If
IGNBRK is set, a break condition detected on input is ignored, that is, not put on the input queue and therefore not read by any process. If
IGNBRK is not set and
BRKINT is set, the break condition flushes the input and output queues and if the terminal is the controlling terminal of a foreground process group, the break condition generates a single
SIGINT signal to that foreground process group. If neither
IGNBRK nor
BRKINT is set, a break condition is read as a single ‘\0', or if
PARMRK is set, as ‘\377', ‘\0', ‘\0'.
If
IGNPAR is set, a byte with a framing or parity error (other than break) is ignored.
If
PARMRK is set, and
IGNPAR is not set, a byte with a framing or parity error (other than break) is given to the application as the three-character sequence ‘\377', ‘\0', X, where ‘\377', ‘\0' is a two-character flag preceding each sequence and X is the data of the character received in error. To avoid ambiguity in this case, if
ISTRIP is not set, a valid character of ‘\377' is given to the application as ‘\377', ‘\377'. If neither
PARMRK nor
IGNPAR is set, a framing or parity error (other than break) is given to the application as a single character ‘\0'.
If
INPCK is set, input parity checking is enabled. If
INPCK is not set, input parity checking is disabled, allowing output parity generation without input parity errors. Note that whether input parity checking is enabled or disabled is independent of whether parity detection is enabled or disabled (see
Control Modes). If parity detection is enabled but input parity checking is disabled, the hardware to which the terminal is connected recognizes the parity bit, but the terminal special file does not check whether this bit is set correctly or not.
If
ISTRIP is set, valid input bytes are first stripped to seven bits, otherwise all eight bits are processed.
If
INLCR is set, a received
NL character is translated into a
CR character. If
IGNCR is set, a received
CR character is ignored (not read). If
IGNCR is not set and
ICRNL is set, a received
CR character is translated into a
NL character.
If
IXON is set, start/stop output control is enabled. A received
STOP character suspends output and a received
START character restarts output. If
IXANY is also set, then any character may restart output. When
IXON is set,
START and
STOP characters are not read, but merely perform flow control functions. When
IXON is not set, the
START and
STOP characters are read.
If
IXOFF is set, start/stop input control is enabled. The system shall transmit one or more
STOP characters, which are intended to cause the terminal device to stop transmitting data, as needed to prevent the input queue from overflowing and causing the undefined behavior described in
Input Processing and Reading Data, and shall transmit one or more
START characters, which are intended to cause the terminal device to resume transmitting data, as soon as the device can continue transmitting data without risk of overflowing the input queue. The precise conditions under which
STOP and START characters are transmitted are implementation defined.
If
IMAXBEL is set and the input queue is full, subsequent input shall cause an ASCII
BEL character to be transmitted to the output queue.
The initial input control value after
open(2) is implementation defined.