termios.h(3)               POSIX Programmer's Manual              termios.h(3)



PPRROOLLOOGG
       This manual page is part of the POSIX Programmer's Manual.  The OS
       implementation of this interface may differ (consult the corresponding
       OS manual page for details of OS behavior), or the interface may not be
       implemented on OS.

NNAAMMEE
       termios.h -- define values for termios

SSYYNNOOPPSSIISS
       #include <termios.h>

DDEESSCCRRIIPPTTIIOONN
       The _<_t_e_r_m_i_o_s_._h_> header shall contain the definitions used by the
       terminal I/O interfaces (see _C_h_a_p_t_e_r _1_1, _G_e_n_e_r_a_l _T_e_r_m_i_n_a_l _I_n_t_e_r_f_a_c_e for
       the structures and names defined).

   TThhee tteerrmmiiooss SSttrruuccttuurree
       The _<_t_e_r_m_i_o_s_._h_> header shall define the following data types through
       ttyyppeeddeeff:

       cccc__tt        Used for terminal special characters.

       ssppeeeedd__tt     Used for terminal baud rates.

       ttccffllaagg__tt    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 cccc__tt, ssppeeeedd__tt, and ttccffllaagg__tt are no greater than
       the width of type lloonngg.  The names of these programming environments
       can be obtained using the _c_o_n_f_s_t_r() function or the _g_e_t_c_o_n_f utility.

       The _<_t_e_r_m_i_o_s_._h_> header shall define the tteerrmmiiooss structure, which 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.

       The _<_t_e_r_m_i_o_s_._h_> header shall define the following symbolic constant:

       NCCS        Size of the array _c___c_c for control characters.

       The _<_t_e_r_m_i_o_s_._h_> header shall define the following symbolic constants
       for use as subscripts for the array _c___c_c:

              +------------------------------------+------------------+
              |          SSuubbssccrriipptt UUssaaggee           |                  |
              |CCaannoonniiccaall MMooddee   NNoonn--CCaannoonniiccaall MMooddee |   DDeessccrriippttiioonn    |
              +---------------+--------------------+------------------+
              |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 suitable for use in ##iiff preprocessing
       directives and shall be distinct, except that the VMIN and VTIME
       subscripts may have the same values as the VEOF and VEOL subscripts,
       respectively.

   IInnppuutt MMooddeess
       The _<_t_e_r_m_i_o_s_._h_> header shall define the following symbolic constants
       for use as flags in the _c___i_f_l_a_g field. The _c___i_f_l_a_g 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.

       IXANY       Enable any character to restart output.

       IXOFF       Enable start/stop input control.

       IXON        Enable start/stop output control.

       PARMRK      Mark parity errors.

   OOuuttppuutt MMooddeess
       The _<_t_e_r_m_i_o_s_._h_> header shall define the following symbolic constants
       for use as flags in the _c___o_f_l_a_g field. The _c___o_f_l_a_g field specifies the
       system treatment of output.

       OPOST       Post-process 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.

       OFDEL       Fill is DEL.

       OFILL       Use fill characters for delay.

       NLDLY       Select newline delays:

                   NL0     Newline type 0.

                   NL1     Newline 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.

   BBaauudd RRaattee SSeelleeccttiioonn
       The _<_t_e_r_m_i_o_s_._h_> header shall define the following symbolic constants
       for use as values of objects of type ssppeeeedd__tt.

       The input and output baud rates are stored in the tteerrmmiiooss structure.
       These are the valid values for objects of type ssppeeeedd__tt.  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

   CCoonnttrrooll MMooddeess
       The _<_t_e_r_m_i_o_s_._h_> header shall define the following symbolic constants
       for use as flags in the _c___c_f_l_a_g field. The _c___c_f_l_a_g 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.

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

   LLooccaall MMooddeess
       The _<_t_e_r_m_i_o_s_._h_> header shall define the following symbolic constants
       for use as flags in the _c___l_f_l_a_g field. The _c___l_f_l_a_g 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.

   AAttttrriibbuuttee SSeelleeccttiioonn
       The _<_t_e_r_m_i_o_s_._h_> header shall define the following symbolic constants
       for use with _t_c_s_e_t_a_t_t_r():

       TCSANOW     Change attributes immediately.

       TCSADRAIN   Change attributes when output has drained.

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

   LLiinnee CCoonnttrrooll
       The _<_t_e_r_m_i_o_s_._h_> header shall define the following symbolic constants
       for use with _t_c_f_l_u_s_h():

       TCIFLUSH    Flush pending input.

       TCIOFLUSH   Flush both pending input and untransmitted output.

       TCOFLUSH    Flush untransmitted output.

       The _<_t_e_r_m_i_o_s_._h_> header shall define the following symbolic constants
       for use with _t_c_f_l_o_w():

       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 _<_t_e_r_m_i_o_s_._h_> header shall define the ppiidd__tt type as described in
       _<_s_y_s_/_t_y_p_e_s_._h_>.

       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 *);
           pid_t   tcgetsid(int);
           int     tcsendbreak(int, int);
           int     tcsetattr(int, int, const struct termios *);

       _T_h_e _f_o_l_l_o_w_i_n_g _s_e_c_t_i_o_n_s _a_r_e _i_n_f_o_r_m_a_t_i_v_e_.

AAPPPPLLIICCAATTIIOONN UUSSAAGGEE
       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

RRAATTIIOONNAALLEE
       None.

FFUUTTUURREE DDIIRREECCTTIIOONNSS
       None.

SSEEEE AALLSSOO
       <<ssyyss__ttyyppeess..hh>>

       The System Interfaces volume of POSIX.1-2017, _c_f_g_e_t_i_s_p_e_e_d(),
       _c_f_g_e_t_o_s_p_e_e_d(), _c_f_s_e_t_i_s_p_e_e_d(), _c_f_s_e_t_o_s_p_e_e_d(), _c_o_n_f_s_t_r(), _t_c_d_r_a_i_n(),
       _t_c_f_l_o_w(), _t_c_f_l_u_s_h(), _t_c_g_e_t_a_t_t_r(), _t_c_g_e_t_s_i_d(), _t_c_s_e_n_d_b_r_e_a_k(),
       _t_c_s_e_t_a_t_t_r()

       The Shell and Utilities volume of POSIX.1-2017, _C_h_a_p_t_e_r _1_1, _G_e_n_e_r_a_l
       _T_e_r_m_i_n_a_l _I_n_t_e_r_f_a_c_e, _g_e_t_c_o_n_f

CCOOPPYYRRIIGGHHTT
       Portions of this text are reprinted and reproduced in electronic form
       from IEEE Std 1003.1-2017, Standard for Information Technology --
       Portable Operating System Interface (POSIX), The Open Group Base
       Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the
       Institute of Electrical and Electronics Engineers, Inc and The Open
       Group.  In the event of any discrepancy between this version and the
       original IEEE and The Open Group Standard, the original IEEE and The
       Open Group Standard is the referee document. The original Standard can
       be obtained online at http://www.opengroup.org/unix/online.html .

       Any typographical or formatting errors that appear in this page are
       most likely to have been introduced during the conversion of the source
       files to man page format. To report such errors, see
       https://www.kernel.org/doc/man-pages/reporting_bugs.html .



IEEE/The Open Group                  2017                         termios.h(3)
