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 xbd_chap11(7) for the structures and names defined).

The following data types shall be defined through :

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

The above types shall be all unsigned integer types.

The implementation shall support one or more programming environments in which the widths of cc_t, speed_t, and tcflag_t are no greater than the width of type . The names of these programming environments can be obtained using the confstr(3) function or the getconf(1) utility.

The termios structure shall be defined, and shall include 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 characters.

A definition shall be provided for:

Size of the array c_cc for control characters.

The following subscript names for the array shall be 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 shall be unique, except that the VMIN and VTIME subscripts may have the same values as the VEOF and VEOL subscripts, respectively.

The following flags shall be provided.

The 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.
[XSI] Enable any character to restart output.
Enable start/stop input control.
Enable start/stop output control.
Mark parity errors.

The field specifies the system treatment of output:

Post-process output.
[XSI] 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 type 0.
Newline type 1.
Select carriage-return delays:
Carriage-return delay type 0.
Carriage-return delay type 1.
Carriage-return delay type 2.
Carriage-return delay type 3.
Select horizontal-tab delays:
Horizontal-tab delay type 0.
Horizontal-tab delay type 1.
Horizontal-tab delay type 2.
Expand tabs to spaces.
Select backspace delays:
Backspace-delay type 0.
Backspace-delay type 1.
Select vertical-tab delays:
Vertical-tab delay type 0.
Vertical-tab delay type 1.
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 shall be 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 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
Send two stop bits, else one.
Enable receiver.
Parity enable.
Odd parity, else even.
Hang up on last close.
Ignore modem status lines.

The implementation shall support the functionality associated with the symbols CS7, CS8, CSTOPB, PARODD, and PARENB.

The 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.

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) shall be defined:

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

The following symbolic constants for use with tcflow(3) shall be 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 shall be declared as functions and may also be defined as macros. Function prototypes shall be provided.

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 *);
[XSI]
pid_t   tcgetsid(int);

int     tcsendbreak(int, int);
int     tcsetattr(int, int, const struct termios *);

The following names are reserved for XSI-conformant systems to use as an extension to the above; therefore strictly conforming applications shall not use them:

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

None.

None.

The System Interfaces volume of IEEE Std 1003.1-2001 (“POSIX.1”), cfgetispeed(3), cfgetospeed(3), cfsetispeed(3), cfsetospeed(3), confstr(3), tcdrain(3), tcflow(3), tcflush(3), tcgetattr(3), tcgetsid(3), tcsendbreak(3), tcsetattr(3), the Shell and Utilities volume of IEEE Std 1003.1-2001 (“POSIX.1”), getconf(1), xbd_chap11(7)

First released in Issue 3.

Included for alignment with the ISO POSIX-1 standard.

The LEGACY symbols IUCLC, OLCUC, and XCASE are removed.

FIPS 151-2 requirements for the symbols CS7, CS8, CSTOPB, PARODD, and PARENB are reaffirmed.

IEEE Std 1003.1-2001 (“POSIX.1”)/Cor 1-2002, item XBD/TC1/D6/19 is applied, changing ECHOK to ECHOKE in the APPLICATION USAGE section.

footer end

January 1, 2004 posix.fail