The c_oflag
field specifies how the terminal interface handles output. It is constructed from the bitwise inclusive OR of zero or more of the following masks, which are bitwise distinct. The mask names in the table below are defined in termios.h
:
Mask name | Definition |
| Post-process output |
| Map lowercase letters to uppercase on output. Will no longer be |
| Map |
| Map |
| No |
|
|
| Use fill characters for delay |
| The fill character is |
| Select newline (
|
| Select carriage return (
|
|
|
| Select delays for horizontal tabs: Horizontal-tab delay type 0 Horizontal-tab delay type 1 Horizontal-tab delay type 2 Horizontal-tab delay type 3 |
| Select delays for backspace: Backspace-delay type 0 Backspace-delay type 1 |
| Select delays for vertical tabs: Vertical-tab delay type 0 Vertical-tab delay type 1 |
| Select delays for form-feed: Form-feed delay type 0 Form-feed delay type 1 |
If OPOST
is set, output data is post-processed on the basis of the remaining bits of c_oflag
so that lines of text are modified to appear appropriately on the terminal device; otherwise, characters are transmitted without change.
If OLCUC
is set, a lowercase letter is mapped to the corresponding uppercase letter before being transmitted. This function is often used in conjunction with IUCLC
for input modes. Will no longer be supported by the X/Open-Standard in future.
When ONLCR
is set, the NL
character (newline) is transmitted as the character pair CR-NL
(carriage return - newline). If OCRNL
is set, the CR
character is transmitted as an NL
character. When ONOCR
is set, a CR
character in column 0 (first position in the line) is not transmitted. If ONLRET
is set, it is assumed that the NL
character performs the carriage return function; the column pointer is set to 0, and the applicable carriage return delay is used. When ONLRET
is not set, it is assumed that the NL
character just performs the linefeed function; the column pointer will remain unchanged in this case. The column pointer is also set to 0 if the CR
character is actually transmitted.
The delay bits specify how long transmission stops to allow for mechanical or other movement when certain characters are sent to the terminal. In all cases a value of 0 indicates no delay. If OFILL
is set, fill characters will be transmitted for delay instead of a timed delay. This is useful for high baud rate terminals which need only a minimal delay. If OFDEL
is set, the fill character is DEL
, otherwise NUL
.
If a form-feed or vertical-tab delay is specified, the delay will last for about 2 seconds.
A newline delay lasts for about 0.10 seconds. If ONLRET
is specified, carriage-return delays are used instead of newline delays. Two fill characters are transmitted if OFILL
is set.
Carriage-return delay type 1 depends on the current column position, type 2 is about 0.10 seconds, and type 3 is about 0.15 seconds. If OFILL
is set, two fill characters are transmitted for type 1, four for type 2.
Horizontal-tab delay type 1 depends on the current column position. Type 2 lasts for about 0.10 seconds; type 3 specifies that tabs are to be expanded into spaces. If OFILL
is set, two fill characters are transmitted for any delay.
The backspace delay lasts for about 0.05 seconds. One fill character is transmitted if OFILL
is set. The actual delays will depend on the line speed and the load on the system.
The initial value for all output modes (value of c_oflag
) after a call to open()
is that no flag is set.