xref: /illumos-gate/usr/src/man/man3head/termios.h.3head (revision 15c07adc1c7b828006b5e3c4d528b92229d6bd23)

Sun Microsystems, Inc. gratefully acknowledges The Open Group for
permission to reproduce portions of its copyrighted documentation.
Original documentation from The Open Group can be obtained online at
http://www.opengroup.org/bookstore/.

The Institute of Electrical and Electronics Engineers and The Open
Group, have given us permission to reprint portions of their
documentation.

In the following statement, the phrase ``this text'' refers to portions
of the system documentation.

Portions of this text are reprinted and reproduced in electronic form
in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
Standard for Information Technology -- Portable Operating System
Interface (POSIX), The Open Group Base Specifications Issue 6,
Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
Engineers, Inc and The Open Group. In the event of any discrepancy
between these versions 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.

This notice shall appear on any product containing this material.

The contents of this file are subject to the terms of the
Common Development and Distribution License (the "License").
You may not use this file except in compliance with the License.

You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
or http://www.opensolaris.org/os/licensing.
See the License for the specific language governing permissions
and limitations under the License.

When distributing Covered Code, include this CDDL HEADER in each
file and include the License file at usr/src/OPENSOLARIS.LICENSE.
If applicable, add the following below this CDDL HEADER, with the
fields enclosed by brackets "[]" replaced with your own identifying
information: Portions Copyright [yyyy] [name of copyright owner]


Copyright (c) 2001, The IEEE and The Open Group. All Rights Reserved.
Portions Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.

TERMIOS.H 3HEAD "Dec 30, 2016"
NAME
termios.h, termios - define values for termios
SYNOPSIS

#include <termios.h>
DESCRIPTION

The <termios.h> header contains the definitions used by the terminal I/O interfaces. See termios(3C) and termio(7I) for an overview of the terminal interface.

"The termios Structure"

The following data types are defined through typedef: cc_t

used for terminal special characters

speed_t

used for terminal baud rates

tcflag_t

used for terminal modes

The above types are all unsigned integer types.

The implementation supports 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(3C) function or the getconf(1) utility.

The termios structure is defined and includes 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 is provided for: NCCS

size of the array c_cc for control characters

The following subscript names for the array c_cc are defined:

Subscript Usage Subscript Usage Description
Canonical Mode Non-Canonical Mode
VEOF EOF character
VEOL EOL character
VERASE ERASE character
VERASE2 ERASE2 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
VSTATUS STATUS character

The subscript values are unique, except that the VMIN and VTIME subscripts can have the same values as the VEOF and VEOL subscripts, respectively.

The header file provides the flags described below.

"Input Modes"

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

"Output Modes"

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

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

"Baud Rate Selection"

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

1 200 baud

B1800

1 800 baud

B2400

2 400 baud

B4800

4 800 baud

B9600

9 600 baud

B19200

19 200 baud

B38400

38 400 baud

"Control Modes"

The c_cflag 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 supports the functionality associated with the symbols CS7, CS8, CSTOPB, PARODD, and PARENB.

"Local Modes"

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

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

TCIOFLUSH

Flush both pending input and untransmitted output.

TCOFLUSH

Flush untransmitted output.

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.

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE
Interface Stability Standard
SEE ALSO

getconf(1), cfgetispeed(3C), cfsetispeed(3C), confstr(3C), tcdrain(3C), tcflow(3C), tcflush(3C), tcgetattr(3C), tcgetsid(3C), tcsendbreak(3C), tcsetattr(3C), attributes(5), standards(5)