TERMIOS.H(7) Miscellaneous Information Manual TERMIOS.H(7)

termios.hdefine values for termios

#include <termios.h>

The <termios.h> header contains the definitions used by the terminal I/O interfaces (see the XBD specification, General Terminal Interface for the structures and names defined).

The following data types are defined through typedef :

Used for terminal special characters.
Used for terminal baud rates.
Used for terminal modes.

The above types are all unsigned integral types.

The structure is defined, and includes at least the following members: tcflag_t c_iflag input modes tcflag_t c_oflag output modes tcflag_t c_cflag control modes tcflag_t c_lflag local modes cc_t c_cc[NCCS] control chars

A definition is given for:

Size of the array c_cc for control characters.

The following subscript names for the array are defined:

Subscript Usage
Canonical Mode Non-canonical Mode Description
VEOF EOF character
VEOL EOL character
VERASE ERASE character
VINTR VINTR INTR character
VKILL KILL character
VMIN MIN value
VQUIT VQUIT QUIT character
VSTART VSTART START character
VSTOP VSTOP STOP character
VSUSP VSUSP SUSP character
VTIME TIME value
The subscript values are unique, except that the VMIN and VTIME subscripts may have the same values as the VEOF and VEOL subscripts, respectively.

The c_iflag field describes the basic terminal input control:

Signal interrupt on break.
Map CR to NL on input.
Ignore break condition.
Ignore CR
Ignore characters with parity errors.
Map NL to CR on input.
Enable input parity check.
Strip character
Map upper-case to lower-case on input ( LEGACY ).
Enable any character to restart output.
Enable start/stop input control.
Enable start/stop output control.
Mark parity errors.

The c_oflag field specifies the system treatment of output:

Post-process output
Map lower-case to upper-case on output ( LEGACY ).
Map NL to CR-NL on output.
Map CR to NL on output.
No CR output at column 0.
NL performs CR function.
Use fill characters for delay.
Select newline delays:
Newline character type 0.
Newline character type 1.

CRDLY Select carriage-return delays:

Carriage-return delay type 0.
Carriage-return delay type 1.
Carriage-return delay type 2.
Carriage-return delay type 3.

TABDLY Select horizontal-tab delays:

Horizontal-tab delay type 0.
Horizontal-tab delay type 1.
Horizontal-tab delay type 2.
Expand tabs to spaces.

BSDLY Select backspace delays:

Backspace-delay type 0.
Backspace-delay type 1.

VTDLY Select vertical-tab delays:

Vertical-tab delay type 0.
Vertical-tab delay type 1.

FFDLY Select form-feed delays:

Form-feed delay type 0.
Form-feed delay type 1.

The input and output baud rates are stored in the termios structure. These are the valid values for objects of type speed_t . The following values are defined, but not all baud rates need be supported by the underlying hardware.

Hang up
50 baud
75 baud
110 baud
134.5 baud
150 baud
200 baud
300 baud
600 baud
1200 baud
1800 baud
2400 baud
4800 baud
9600 baud
19200 baud
38400 baud

The c_cflag field describes the hardware control of the terminal; not all values specified are required to be supported by the underlying hardware:

Character size:
5 bits.
6 bits.
7 bits.
8 bits.

CSTOPB Send two stop bits, else one.

CREAD Enable receiver.

PARENB Parity enable.

PARODD Odd parity, else even.

HUPCL Hang up on last close.

CLOCAL Ignore modem status lines.

The c_lflag field of the argument structure is used to control various terminal functions:

Enable echo.
Echo erase character as error-correcting backspace.
Echo KILL.
Echo NL.
Canonical input (erase and kill processing).
Enable extended input character processing.
Enable signals.
Disable flush after interrupt or quit.
Send SIGTTOU for background output.
Canonical upper/lower presentation ( LEGACY ).

The following symbolic constants for use with tcsetattr(3) are defined:

Change attributes immediately.
Change attributes when output has drained.
Change attributes when output has drained; also flush pending input.

The following symbolic constants for use with tcflush(3) are defined:

Flush pending input. Flush untransmitted output.
Flush both pending input and untransmitted output.
Flush untransmitted output.

The following symbolic constants for use with are defined:

Transmit a STOP character, intended to suspend input data.
Transmit a START character, intended to restart input data.
Suspend output.
Restart output.

The following are declared as functions and may also be defined as macros. Function prototypes must be provided for use with an ISO C compiler. speed_t cfgetispeed(const struct termios *); speed_t cfgetospeed(const struct termios *); int cfsetispeed(struct termios *, speed_t); int cfsetospeed(struct termios *, speed_t); int tcdrain(int); int tcflow(int, int); int tcflush(int, int); int tcgetattr(int, struct termios *); pid_t tcgetsid(int); int tcsendbreak(int, int); int tcsetattr(int, int, struct termios *);

The following names are commonly used as extensions to the above, therefore portable applications must not use them:

CBAUD EXTB VDSUSP
DEFECHO FLUSHO VLNEXT
ECHOCTL LOBLK VREPRINT
ECHOKE PENDIN VSTATUS
ECHOPRT SWTCH VWERASE
EXTA VDISCARD

None.

cfgetispeed(3) , cfgetospeed(3) , cfsetispeed(3) , cfsetospeed(3) , tcdrain(3) , tcflow(3) , tcflush(3) , tcgetattr(3) , tcgetsid(3) , tcsendbreak(3) , tcsetattr(3) , the XBD specification, General Terminal Interface .

February 1997 posix.fail