'\" te .\" Copyright (c) 2001, The IEEE and The Open Group. All Rights Reserved. Portions Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved. .\" 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 Sun OS 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] .TH termios.h 3HEAD "10 Sep 2004" "SunOS 5.11" "Headers" .SH NAME termios.h, termios \- define values for termios .SH SYNOPSIS .LP .nf #include <\fBtermios.h\fR> .fi .SH DESCRIPTION .sp .LP The <\fBtermios.h\fR> header contains the definitions used by the terminal I/O interfaces. See \fBtermios\fR(3C) and \fBtermio\fR(7I) for an overview of the terminal interface. .SS "The termios Structure" .sp .LP The following data types are defined through \fBtypedef\fR: .sp .ne 2 .mk .na \fB\fBcc_t\fR\fR .ad .RS 12n .rt used for terminal special characters .RE .sp .ne 2 .mk .na \fB\fBspeed_t\fR\fR .ad .RS 12n .rt used for terminal baud rates .RE .sp .ne 2 .mk .na \fB\fBtcflag_t\fR\fR .ad .RS 12n .rt used for terminal modes .RE .sp .LP The above types are all unsigned integer types. .sp .LP The implementation supports one or more programming environments in which the widths of \fBcc_t\fR, \fBspeed_t\fR, and \fBtcflag_t\fR are no greater than the width of type \fBlong\fR. The names of these programming environments can be obtained using the \fBconfstr\fR(3C) function or the \fBgetconf\fR(1) utility. .sp .LP The \fBtermios\fR structure is defined and includes the following members: .sp .in +2 .nf 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 */ .fi .in -2 .sp .LP A definition is provided for: .sp .ne 2 .mk .na \fB\fBNCCS\fR\fR .ad .RS 8n .rt size of the array \fBc_cc\fR for control characters .RE .sp .LP The following subscript names for the array \fBc_cc\fR are defined: .sp .sp .TS tab(); cw(1.47i) cw(1.87i) cw(2.15i) lw(1.47i) lw(1.87i) lw(2.15i) . Subscript UsageCanonical ModeSubscript UsageNon-Canonical ModeDescription _ \fBVEOF\fREOF character \fBVEOL\fREOL character \fBVERASE\fRERASE character \fBVINTR\fR\fBVINTR\fRINTR character \fBVKILL\fRKILL character \fBVMIN\fRMIN value \fBVQUIT\fR\fBVQUIT\fRQUIT character \fBVSTART\fR\fBVSTART\fRSTART character \fBVSTOP\fR\fBVSTOP\fRSTOP character \fBVSUSP\fR\fBVSUSP\fRSUSP character \fBVTIME\fRTIME value .TE .sp .LP The subscript values are unique, except that the \fBVMIN\fR and \fBVTIME\fR subscripts can have the same values as the \fBVEOF\fR and \fBVEOL\fR subscripts, respectively. .sp .LP The header file provides the flags described below. .SS "Input Modes" .sp .LP The \fBc_iflag\fR field describes the basic terminal input control: .sp .ne 2 .mk .na \fB\fBBRKINT\fR\fR .ad .RS 10n .rt Signal interrupt on break. .RE .sp .ne 2 .mk .na \fB\fBICRNL\fR\fR .ad .RS 10n .rt Map CR to NL on input. .RE .sp .ne 2 .mk .na \fB\fBIGNBRK\fR\fR .ad .RS 10n .rt Ignore break condition. .RE .sp .ne 2 .mk .na \fB\fBIGNCR\fR\fR .ad .RS 10n .rt Ignore CR. .RE .sp .ne 2 .mk .na \fB\fBIGNPAR\fR\fR .ad .RS 10n .rt Ignore characters with parity errors. .RE .sp .ne 2 .mk .na \fB\fBINLCR\fR\fR .ad .RS 10n .rt Map NL to CR on input. .RE .sp .ne 2 .mk .na \fB\fBINPCK\fR\fR .ad .RS 10n .rt Enable input parity check. .RE .sp .ne 2 .mk .na \fB\fBISTRIP\fR\fR .ad .RS 10n .rt Strip character. .RE .sp .ne 2 .mk .na \fB\fBIXANY\fR\fR .ad .RS 10n .rt Enable any character to restart output. .RE .sp .ne 2 .mk .na \fB\fBIXOFF\fR\fR .ad .RS 10n .rt Enable start/stop input control. .RE .sp .ne 2 .mk .na \fB\fBIXON\fR\fR .ad .RS 10n .rt Enable start/stop output control. .RE .sp .ne 2 .mk .na \fB\fBPARMRK\fR\fR .ad .RS 10n .rt Mark parity errors. .RE .SS "Output Modes" .sp .LP The \fBc_oflag\fR field specifies the system treatment of output: .sp .ne 2 .mk .na \fB\fBOPOST\fR\fR .ad .RS 10n .rt Post-process output. .RE .sp .ne 2 .mk .na \fB\fBONLCR\fR\fR .ad .RS 10n .rt Map NL to CR-NL on output. .RE .sp .ne 2 .mk .na \fB\fBOCRNL\fR\fR .ad .RS 10n .rt Map CR to NL on output. .RE .sp .ne 2 .mk .na \fB\fBONOCR\fR\fR .ad .RS 10n .rt No CR output at column 0. .RE .sp .ne 2 .mk .na \fB\fBONLRET\fR\fR .ad .RS 10n .rt NL performs CR function. .RE .sp .ne 2 .mk .na \fB\fBOFILL\fR\fR .ad .RS 10n .rt Use fill characters for delay. .RE .sp .ne 2 .mk .na \fB\fBNLDLY\fR\fR .ad .RS 10n .rt Select newline delays: .sp .ne 2 .mk .na \fB\fBNL0\fR\fR .ad .RS 7n .rt newline type 0 .RE .sp .ne 2 .mk .na \fB\fBNL1\fR\fR .ad .RS 7n .rt newline type 1 .RE .RE .sp .ne 2 .mk .na \fB\fBCRDLY\fR\fR .ad .RS 10n .rt Select carriage-return delays: .sp .ne 2 .mk .na \fB\fBCR0\fR\fR .ad .RS 7n .rt carriage-return delay type 0 .RE .sp .ne 2 .mk .na \fB\fBCR1\fR\fR .ad .RS 7n .rt carriage-return delay type 1 .RE .sp .ne 2 .mk .na \fB\fBCR2\fR\fR .ad .RS 7n .rt carriage-return delay type 2 .RE .sp .ne 2 .mk .na \fB\fBCR3\fR\fR .ad .RS 7n .rt carriage-return delay type 3 .RE .RE .sp .ne 2 .mk .na \fB\fBTABDLY\fR\fR .ad .RS 10n .rt Select horizontal-tab delays: .sp .ne 2 .mk .na \fB\fBTAB0\fR\fR .ad .RS 8n .rt horizontal-tab delay type 0 .RE .sp .ne 2 .mk .na \fB\fBTAB1\fR\fR .ad .RS 8n .rt horizontal-tab delay type 1 .RE .sp .ne 2 .mk .na \fB\fBTAB2\fR\fR .ad .RS 8n .rt horizontal-tab delay type 2 .RE .sp .ne 2 .mk .na \fB\fBTAB3\fR\fR .ad .RS 8n .rt expand tabs to spaces .RE .RE .sp .ne 2 .mk .na \fB\fBBSDLY\fR\fR .ad .RS 10n .rt Select backspace delays: .sp .ne 2 .mk .na \fB\fBBS0\fR\fR .ad .RS 7n .rt backspace-delay type 0 .RE .sp .ne 2 .mk .na \fB\fBBS1\fR\fR .ad .RS 7n .rt backspace-delay type 1 .RE .RE .sp .ne 2 .mk .na \fB\fBVTDLY\fR\fR .ad .RS 10n .rt Select vertical-tab delays: .sp .ne 2 .mk .na \fB\fBVT0\fR\fR .ad .RS 7n .rt vertical-tab delay type 0 .RE .sp .ne 2 .mk .na \fB\fBVT1\fR\fR .ad .RS 7n .rt vertical-tab delay type 1 .RE .RE .sp .ne 2 .mk .na \fB\fBFFDLY\fR\fR .ad .RS 10n .rt Select form-feed delays: .sp .ne 2 .mk .na \fB\fBFF0\fR\fR .ad .RS 7n .rt form-feed delay type 0 .RE .sp .ne 2 .mk .na \fB\fBFF1\fR\fR .ad .RS 7n .rt form-feed delay type 1 .RE .RE .SS "Baud Rate Selection" .sp .LP The input and output baud rates are stored in the \fBtermios\fR structure. These are the valid values for objects of type \fBspeed_ t\fR. The following values are defined, but not all baud rates need be supported by the underlying hardware. .sp .ne 2 .mk .na \fB\fBB0\fR\fR .ad .RS 10n .rt Hang up .RE .sp .ne 2 .mk .na \fB\fBB50\fR\fR .ad .RS 10n .rt 50 baud .RE .sp .ne 2 .mk .na \fB\fBB75\fR\fR .ad .RS 10n .rt 75 baud .RE .sp .ne 2 .mk .na \fB\fBB110\fR\fR .ad .RS 10n .rt 110 baud .RE .sp .ne 2 .mk .na \fB\fBB134\fR\fR .ad .RS 10n .rt 134.5 baud .RE .sp .ne 2 .mk .na \fB\fBB150\fR\fR .ad .RS 10n .rt 150 baud .RE .sp .ne 2 .mk .na \fB\fBB200\fR\fR .ad .RS 10n .rt 200 baud .RE .sp .ne 2 .mk .na \fB\fBB300\fR\fR .ad .RS 10n .rt 300 baud .RE .sp .ne 2 .mk .na \fB\fBB600\fR\fR .ad .RS 10n .rt 600 baud .RE .sp .ne 2 .mk .na \fB\fBB1200\fR\fR .ad .RS 10n .rt 1 200 baud .RE .sp .ne 2 .mk .na \fB\fBB1800\fR\fR .ad .RS 10n .rt 1 800 baud .RE .sp .ne 2 .mk .na \fB\fBB2400\fR\fR .ad .RS 10n .rt 2 400 baud .RE .sp .ne 2 .mk .na \fB\fBB4800\fR\fR .ad .RS 10n .rt 4 800 baud .RE .sp .ne 2 .mk .na \fB\fBB9600\fR\fR .ad .RS 10n .rt 9 600 baud .RE .sp .ne 2 .mk .na \fB\fBB19200\fR\fR .ad .RS 10n .rt 19 200 baud .RE .sp .ne 2 .mk .na \fB\fBB38400\fR\fR .ad .RS 10n .rt 38 400 baud .RE .SS "Control Modes" .sp .LP The \fBc_cflag\fR field describes the hardware control of the terminal; not all values specified are required to be supported by the underlying hardware: .sp .ne 2 .mk .na \fB\fBCSIZE\fR\fR .ad .RS 10n .rt Character size: .sp .ne 2 .mk .na \fB\fBCS5\fR\fR .ad .RS 7n .rt 5 bits .RE .sp .ne 2 .mk .na \fB\fBCS6\fR\fR .ad .RS 7n .rt 6 bits .RE .sp .ne 2 .mk .na \fB\fBCS7\fR\fR .ad .RS 7n .rt 7 bits .RE .sp .ne 2 .mk .na \fB\fBCS8\fR\fR .ad .RS 7n .rt 8 bits .RE .RE .sp .ne 2 .mk .na \fB\fBCSTOPB\fR\fR .ad .RS 10n .rt Send two stop bits, else one. .RE .sp .ne 2 .mk .na \fB\fBCREAD\fR\fR .ad .RS 10n .rt Enable receiver. .RE .sp .ne 2 .mk .na \fB\fBPARENB\fR\fR .ad .RS 10n .rt Parity enable. .RE .sp .ne 2 .mk .na \fB\fBPARODD\fR\fR .ad .RS 10n .rt Odd parity, else even. .RE .sp .ne 2 .mk .na \fB\fBHUPCL\fR\fR .ad .RS 10n .rt Hang up on last close. .RE .sp .ne 2 .mk .na \fB\fBCLOCAL\fR\fR .ad .RS 10n .rt Ignore modem status lines. .RE .sp .LP The implementation supports the functionality associated with the symbols \fBCS7\fR, \fBCS8\fR, \fBCSTOPB\fR, \fBPARODD\fR, and \fBPARENB\fR. .SS "Local Modes" .sp .LP The \fBc_lflag\fR field of the argument structure is used to control various terminal functions: .sp .ne 2 .mk .na \fB\fBECHO\fR\fR .ad .RS 10n .rt Enable echo. .RE .sp .ne 2 .mk .na \fB\fBECHOE\fR\fR .ad .RS 10n .rt Echo erase character as error-correcting backspace. .RE .sp .ne 2 .mk .na \fB\fBECHOK\fR\fR .ad .RS 10n .rt Echo KILL. .RE .sp .ne 2 .mk .na \fB\fBECHONL\fR\fR .ad .RS 10n .rt Echo NL. .RE .sp .ne 2 .mk .na \fB\fBICANON\fR\fR .ad .RS 10n .rt Canonical input (erase and kill processing). .RE .sp .ne 2 .mk .na \fB\fBIEXTEN\fR\fR .ad .RS 10n .rt Enable extended input character processing. .RE .sp .ne 2 .mk .na \fB\fBISIG\fR\fR .ad .RS 10n .rt Enable signals. .RE .sp .ne 2 .mk .na \fB\fBNOFLSH\fR\fR .ad .RS 10n .rt Disable flush after interrupt or quit. .RE .sp .ne 2 .mk .na \fB\fBTOSTOP\fR\fR .ad .RS 10n .rt Send \fBSIGTTOU\fR for background output. .RE .SS "Attribute Selection" .sp .LP The following symbolic constants for use with \fBtcsetattr()\fR are defined: .sp .ne 2 .mk .na \fB\fBTCSANOW\fR\fR .ad .RS 13n .rt Change attributes immediately. .RE .sp .ne 2 .mk .na \fB\fBTCSADRAIN\fR\fR .ad .RS 13n .rt Change attributes when output has drained. .RE .sp .ne 2 .mk .na \fB\fBTCSAFLUSH\fR\fR .ad .RS 13n .rt Change attributes when output has drained; also flush pending input. .RE .SS "Line Control" .sp .LP The following symbolic constants for use with \fBtcflush()\fR are defined: .sp .ne 2 .mk .na \fB\fBTCIFLUSH\fR\fR .ad .RS 13n .rt Flush pending input. .RE .sp .ne 2 .mk .na \fB\fBTCIOFLUSH\fR\fR .ad .RS 13n .rt Flush both pending input and untransmitted output. .RE .sp .ne 2 .mk .na \fB\fBTCOFLUSH\fR\fR .ad .RS 13n .rt Flush untransmitted output. .RE .sp .LP The following symbolic constants for use with \fBtcflow()\fR are defined: .sp .ne 2 .mk .na \fB\fBTCIOFF\fR\fR .ad .RS 10n .rt Transmit a \fBSTOP\fR character, intended to suspend input data. .RE .sp .ne 2 .mk .na \fB\fBTCION\fR\fR .ad .RS 10n .rt Transmit a \fBSTART\fR character, intended to restart input data. .RE .sp .ne 2 .mk .na \fB\fBTCOOFF\fR\fR .ad .RS 10n .rt Suspend output. .RE .sp .ne 2 .mk .na \fB\fBTCOON\fR\fR .ad .RS 10n .rt Restart output. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Interface StabilityStandard .TE .SH SEE ALSO .sp .LP \fBgetconf\fR(1), \fBcfgetispeed\fR(3C), \fBcfsetispeed\fR(3C), \fBconfstr\fR(3C), \fBtcdrain\fR(3C), \fBtcflow\fR(3C), \fBtcflush\fR(3C), \fBtcgetattr\fR(3C), \fBtcgetsid\fR(3C), \fBtcsendbreak\fR(3C), \fBtcsetattr\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)