termios.h(7POSIX) | POSIX Programmer's Manual | termios.h(7POSIX) |
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.
termios.h — define values for termios
#include <termios.h>
The <termios.h> header shall contain the definitions used by the terminal I/O interfaces (see Chapter 11, General Terminal Interface for the structures and names defined).
The <termios.h> header shall define the following data types through typedef:
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 long. The names of these programming environments can be obtained using the confstr() function or the getconf utility.
The <termios.h> header shall define the termios 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 <termios.h> header shall define the following symbolic constant:
The <termios.h> header shall define the following symbolic constants for use as subscripts for the array c_cc:
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 suitable for use in #if 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.
The <termios.h> header shall define the following symbolic constants for use as flags in the c_iflag field. The c_iflag field describes the basic terminal input control.
The <termios.h> header shall define the following symbolic constants for use as flags in the c_oflag field. The c_oflag field specifies the system treatment of output.
The <termios.h> header shall define the following symbolic constants for use as values of objects of type speed_t.
The input and output baud rates are stored in the termios structure. These are the valid values for objects of type speed_t. Not all baud rates need be supported by the underlying hardware.
The <termios.h> header shall define the following symbolic constants for use as flags in the c_cflag field. The c_cflag field describes the hardware control of the terminal; not all values specified are required to be supported by the underlying hardware.
The implementation shall support the functionality associated with the symbols CS7, CS8, CSTOPB, PARODD, and PARENB.
The <termios.h> header shall define the following symbolic constants for use as flags in the c_lflag field. The c_lflag field of the argument structure is used to control various terminal functions.
The <termios.h> header shall define the following symbolic constants for use with tcsetattr():
The <termios.h> header shall define the following symbolic constants for use with tcflush():
The <termios.h> header shall define the following symbolic constants for use with tcflow():
The <termios.h> header shall define the pid_t type as described in <sys/types.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 *);
The following sections are informative.
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.
<sys_types.h>
The System Interfaces volume of POSIX.1‐2017, cfgetispeed(), cfgetospeed(), cfsetispeed(), cfsetospeed(), confstr(), tcdrain(), tcflow(), tcflush(), tcgetattr(), tcgetsid(), tcsendbreak(), tcsetattr()
The Shell and Utilities volume of POSIX.1‐2017, Chapter 11, General Terminal Interface, getconf
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 .
2017 | IEEE/The Open Group |