termios(5) termios(5)
NAME
termios - define values for termios
SYNOPSIS
#include <termios.h>
DESCRIPTION
The <termios.h> header contains the definitions used by the terminal
I/O interfaces.
The termios Structure
The following data types are defined through typedef:
cct Used for terminal special characters.
speedt Used for terminal baud rates.
tcflagt Used for terminal modes.
The above types are all unsigned integral types.
The termios structure is defined, and includes at least the following
members:
tcflagt ciflag input modes
tcflagt coflag output modes
tcflagt ccflag control modes
tcflagt clflag local modes
cct ccc[NCCS] control chars
A definition is given for:
NCCS Size of the array ccc for control characters.
Page 1 Reliant UNIX 5.44 Printed 11/98
termios(5) termios(5)
The following subscript names for the array ccc are defined:
_____________________________________________
| Subscript Usage |
| Canonical Non-Canonical |
| Mode 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 character |
|____________________________________________|
Input Modes
The subscript values are unique, except that the VMIN and VTIME sub-
scripts may have the same values as the VEOF and VEOL subscripts,
respectively. The ciflag field describes the basic terminal input
control:
BRKINT Signal interrupt on break.
ICRNL Map CR to NL on input.
IGNBRK Ignore break condition.
IGNCR Ignore CR.
IGNPAR Ignore characters with parity errors.
INLCR Map NL to CR on input.
INPCK Enable input parity check.
ISTRIP Strip character.
IUCLC Map upper case to lower case on input.
IXANY Enable any character to restart output.
IXOFF Enable start/stop input control.
IXON Enable start/stop output control.
PARMRK Mark parity errors.
Page 2 Reliant UNIX 5.44 Printed 11/98
termios(5) termios(5)
Output Modes
The coflag field specifies the system treatment of output:
OPOST Post-process output.
OLCUC Map lower-case to upper-case on output.
ONLCR Map NL to CR-NL on output.
OCRNL Map CR to NL on output.
ONOCR No CR output at column 0.
ONLRET NL performs CR function.
OFILL Use fill characters for delay.
NLDLY Select newline delays:
NL0 Newline character type 0.
NL1 Newline character type 1.
CRDLY Select carriage-return delays:
CR0 Carriage-return delay type 0.
CR1 Carriage-return delay type 1.
CR2 Carriage-return delay type 2.
CR3 Carriage-return delay type 3.
TABDLY Select horizontal-tab delays:
TAB0 Horizontal-tab delay type 0.
TAB1 Horizontal-tab delay type 1.
TAB2 Horizontal-tab delay type 2.
TAB3 Expand tabs to spaces.
BSDLY Select backspace delays:
BS0 Backspace-delay type 0.
BS1 Backspace-delay type 1.
VTDLY Select vertical-tab delays:
VT0 Vertical-tab delay type 0.
VT1 Vertical-tab delay type 1.
FFDLY Select form-feed delays:
FF0 Form-feed delay type 0.
FF1 Form-feed delay type 1.
Page 3 Reliant UNIX 5.44 Printed 11/98
termios(5) termios(5)
Baud Rate Selection
The input and output baud rates are stored in the termios structure.
These are the valid values for objects of type speedt. The following
values are defined, but not all baud rates need be supported by the
underlying hardware.
B0 Hang up
B50 50 baud
B75 75 baud
B110 110 baud
B134 134.5 baud
B150 150 baud
B200 200 baud
B300 300 baud
B600 600 baud
B1200 1200 baud
B1800 1800 baud
B2400 2400 baud
B4800 4800 baud
B9600 9600 baud
B19200 19200 baud
B38400 38400 baud
Control Modes
The ccflag field describes the hardware control of the terminal; not
all values specified are required to be supported by the underlying
hardware:
CSIZE Character size:
CS5 5 bits.
CS6 6 bits.
CS7 7 bits.
CS8 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.
Page 4 Reliant UNIX 5.44 Printed 11/98
termios(5) termios(5)
Local Modes
The clflag field of the argument structure is used to control various
terminal functions:
ECHO Enable echo.
ECHOE Echo erase character as error-correcting backspace.
ECHOK Echo KILL.
ECHONL Echo NL.
ICANON Canonical input (erase and kill processing).
IEXTEN Enable extended input character processing.
ISIG Enable signals.
NOFLSH Disable flush after interrupt or quit.
TOSTOP Send SIGTTOU for background output.
XCASE Canonical upper/lower presentation.
Attribute Selection
The following symbolic constants for use with tcsetattr() are defined:
TCSANOW Change attributes immediately.
TCSADRAIN Change attributes when output has drained.
TCSAFLUSH Change attributes when output has drained; also flush
pending input.
Line Control
The following symbolic constants for use with tcflush() are defined:
TCIFLUSH Flush pending input.
TCOFLUSH Flush untransmitted output.
TCIOFLUSH Flush both pending input and untransmitted output.
Page 5 Reliant UNIX 5.44 Printed 11/98
termios(5) termios(5)
The following symbolic constants for use with tcflow() are defined:
TCIOFF Transmit a STOP character, intended to suspend input
data.
TCION Transmit a START character, intended to restart input
data.
TCOOFF Suspend output.
TCOON Restart output.
The following are declared as functions and may also be defined as
macros:
speedt cfgetispeed(const struct termios *termiosp);
speedt cfgetospeed(const struct termios *termiosp);
int cfsetispeed(struct termios *termiosp, speedt speed);
int cfsetospeed(struct termios *termiosp, speedt speed);
int tcdrain(int fildes);
int tcflow(int fildes, int action);
int tcflush(int fildes, int queueselector);
int tcgetattr(int fildes, struct termios *termiosp);
pidt tcgetsid(int fildes);
int tcsendbreak(int fildes, int duration);
int tcsetattr(int fildes, int optionalactions,
struct termios *termiosp);
APPLICATION USAGE
The following names are commonly used as extensions to the above. They
are therefore reserved and portable applications should not use them.
CBAUD EXTB VDSUSP
DEFECHO FLUSHO VLNEXT
ECHOCTL LOBLK VREPRINT
ECHOKE PENDIN VSTATUS
ECHOPRT SWTCH VWERASE
EXTA VDISCARD
SEE ALSO
termios(2).
Page 6 Reliant UNIX 5.44 Printed 11/98