OSDN Git Service

(split) LDP: Update original to LDP v3.50.
[linuxjm/LDP_man-pages.git] / original / man3 / termios.3
index 3d096c1..d668a4b 100644 (file)
@@ -1,9 +1,8 @@
-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\"
 .\" Copyright (c) 1993 Michael Haardt
 .\" (michael@moria.de)
 .\" Fri Apr  2 11:32:09 MET DST 1993
 .\"
+.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
 .\" This is free documentation; you can redistribute it and/or
 .\" modify it under the terms of the GNU General Public License as
 .\" published by the Free Software Foundation; either version 2 of
@@ -20,9 +19,9 @@
 .\" GNU General Public License for more details.
 .\"
 .\" You should have received a copy of the GNU General Public
-.\" License along with this manual; if not, write to the Free
-.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
-.\" USA.
+.\" License along with this manual; if not, see
+.\" <http://www.gnu.org/licenses/>.
+.\" %%%LICENSE_END
 .\"
 .\" Modified 1993-07-24 by Rik Faith <faith@cs.unc.edu>
 .\" Modified 1995-02-25 by Jim Van Zandt <jrv@vanzandt.mv.com>
@@ -38,7 +37,7 @@
 .\"     Enhanced the discussion of "raw" mode for cfmakeraw().
 .\"     Document CMSPAR.
 .\"
-.TH TERMIOS 3 2007-11-26 "Linux" "Linux Programmer's Manual"
+.TH TERMIOS 3 2013-03-15 "Linux" "Linux Programmer's Manual"
 .SH NAME
 termios, tcgetattr, tcsetattr, tcsendbreak, tcdrain, tcflush, tcflow,
 cfmakeraw, cfgetospeed, cfgetispeed, cfsetispeed, cfsetospeed, cfsetspeed \-
@@ -86,7 +85,7 @@ _BSD_SOURCE
 .SH DESCRIPTION
 The termios functions describe a general terminal interface that is
 provided to control asynchronous communications ports.
-.SS "The termios structure"
+.SS The termios structure
 .LP
 Many of the functions described here have a \fItermios_p\fP argument
 that is a pointer to a \fItermios\fP structure.
@@ -98,7 +97,7 @@ 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 chars */
+cc_t     c_cc[NCCS];   /* special characters */
 .fi
 .in
 .PP
@@ -396,10 +395,11 @@ If \fBICANON\fP is also set, the KILL character erases the current line.
 If \fBICANON\fP is also set, echo the NL character even if ECHO is not set.
 .TP
 .B ECHOCTL
-(not in POSIX) If \fBECHO\fP is also set, ASCII control signals other than
+(not in POSIX) If \fBECHO\fP is also set,
+terminal special characters other than
 TAB, NL, START, and STOP are echoed as \fB^X\fP,
 where X is the character with
-ASCII code 0x40 greater than the control signal.
+ASCII code 0x40 greater than the special character.
 For example, character
 0x08 (BS) is echoed as \fB^H\fP.
 [requires
@@ -408,7 +408,7 @@ or
 .BR _SVID_SOURCE ]
 .TP
 .B ECHOPRT
-(not in POSIX) If \fBICANON\fP and \fBIECHO\fP are also set, characters
+(not in POSIX) If \fBICANON\fP and \fBECHO\fP are also set, characters
 are printed as they are being erased.
 [requires
 .B _BSD_SOURCE
@@ -438,13 +438,9 @@ or
 .BR _SVID_SOURCE ]
 .TP
 .B NOFLSH
-Disable flushing the input and output queues when generating the
-.BR SIGINT ,
-.BR SIGQUIT ,
-and
-.B SIGSUSP
-signals.
-.\" Stevens lets SIGSUSP only flush the input queue
+Disable flushing the input and output queues when generating signals for the
+INT, QUIT, and SUSP characters.
+.\" Stevens lets SUSP only flush the input queue
 .TP
 .B TOSTOP
 Send the
@@ -469,94 +465,134 @@ This flag, as well as \fBICANON\fP must be enabled for the
 special characters EOL2, LNEXT, REPRINT, WERASE to be interpreted,
 and for the \fBIUCLC\fP flag to be effective.
 .PP
-The \fIc_cc\fP array defines the special control characters.
+The \fIc_cc\fP array defines the terminal special characters.
 The symbolic indices (initial values) and meaning are:
 .TP
-.B VINTR
-(003, ETX, Ctrl-C, or also 0177, DEL, rubout)
-Interrupt character.
-Send a
-.B SIGINT
-signal.
+.B VDISCARD
+(not in POSIX; not supported under Linux; 017, SI, Ctrl-O)
+Toggle: start/stop discarding pending output.
 Recognized when
-.B ISIG
+.B IEXTEN
 is set, and then not passed as input.
 .TP
-.B VQUIT
-(034, FS, Ctrl-\e)
-Quit character.
-Send
-.B SIGQUIT
-signal.
+.B VDSUSP
+(not in POSIX; not supported under Linux; 031, EM, Ctrl-Y)
+Delayed suspend character (DSUSP):
+send
+.B SIGTSTP
+signal when the character is read by the user program.
 Recognized when
+.B IEXTEN
+and
 .B ISIG
+are set, and the system supports
+job control, and then not passed as input.
+.TP
+.B VEOF
+(004, EOT, Ctrl-D)
+End-of-file character (EOF).
+More precisely: this character causes the pending tty buffer to be sent
+to the waiting user program without waiting for end-of-line.
+If it is the first character of the line, the
+.BR read (2)
+in the user program returns 0, which signifies end-of-file.
+Recognized when
+.B ICANON
 is set, and then not passed as input.
 .TP
+.B VEOL
+(0, NUL)
+Additional end-of-line character (EOL).
+Recognized when
+.B ICANON
+is set.
+.TP
+.B VEOL2
+(not in POSIX; 0, NUL)
+Yet another end-of-line character (EOL2).
+Recognized when
+.B ICANON
+is set.
+.TP
 .B VERASE
 (0177, DEL, rubout, or 010, BS, Ctrl-H, or also #)
-Erase character.
+Erase character (ERASE).
 This erases the previous not-yet-erased character,
 but does not erase past EOF or beginning-of-line.
 Recognized when
 .B ICANON
 is set, and then not passed as input.
 .TP
+.B VINTR
+(003, ETX, Ctrl-C, or also 0177, DEL, rubout)
+Interrupt character (INTR).
+Send a
+.B SIGINT
+signal.
+Recognized when
+.B ISIG
+is set, and then not passed as input.
+.TP
 .B VKILL
 (025, NAK, Ctrl-U, or Ctrl-X, or also @)
-Kill character.
+Kill character (KILL).
 This erases the input since the last EOF or beginning-of-line.
 Recognized when
 .B ICANON
 is set, and then not passed as input.
 .TP
-.B VEOF
-(004, EOT, Ctrl-D)
-End-of-file character.
-More precisely: this character causes the pending tty buffer to be sent
-to the waiting user program without waiting for end-of-line.
-If it is the first character of the line, the
-.BR read (2)
-in the user program returns 0, which signifies end-of-file.
+.B VLNEXT
+(not in POSIX; 026, SYN, Ctrl-V)
+Literal next (LNEXT).
+Quotes the next input character, depriving it of
+a possible special meaning.
 Recognized when
-.B ICANON
+.B IEXTEN
 is set, and then not passed as input.
 .TP
 .B VMIN
-Minimum number of characters for noncanonical read.
+Minimum number of characters for noncanonical read (MIN).
 .TP
-.B VEOL
-(0, NUL)
-Additional end-of-line character.
+.B VQUIT
+(034, FS, Ctrl-\e)
+Quit character (QUIT).
+Send
+.B SIGQUIT
+signal.
 Recognized when
-.B ICANON
-is set.
-.TP
-.B VTIME
-Timeout in deciseconds for noncanonical read.
+.B ISIG
+is set, and then not passed as input.
 .TP
-.B VEOL2
-(not in POSIX; 0, NUL)
-Yet another end-of-line character.
+.B VREPRINT
+(not in POSIX; 022, DC2, Ctrl-R)
+Reprint unread characters (REPRINT).
 Recognized when
 .B ICANON
-is set.
-.TP
-.B VSWTCH
-(not in POSIX; not supported under Linux; 0, NUL)
-Switch character.
-(Used by \fBshl\fP only.)
+and
+.B IEXTEN
+are set, and then not passed as input.
 .TP
 .B VSTART
 (021, DC1, Ctrl-Q)
-Start character.
+Start character (START).
 Restarts output stopped by the Stop character.
 Recognized when
 .B IXON
 is set, and then not passed as input.
 .TP
+.B VSTATUS
+(not in POSIX; not supported under Linux;
+status request: 024, DC4, Ctrl-T).
+Status character (STATUS).
+Display status information at terminal,
+including state of foreground process and amount of CPU time it has consumed.
+Also sends a
+.BR SIGINFO
+signal (not supported on Linux) to the foreground process group.
+.TP
 .B VSTOP
 (023, DC3, Ctrl-S)
-Stop character.
+Stop character (STOP).
 Stop output until Start character typed.
 Recognized when
 .B IXON
@@ -564,7 +600,7 @@ is set, and then not passed as input.
 .TP
 .B VSUSP
 (032, SUB, Ctrl-Z)
-Suspend character.
+Suspend character (SUSP).
 Send
 .B SIGTSTP
 signal.
@@ -572,58 +608,32 @@ Recognized when
 .B ISIG
 is set, and then not passed as input.
 .TP
-.B VDSUSP
-(not in POSIX; not supported under Linux; 031, EM, Ctrl-Y)
-Delayed suspend character:
-send
-.B SIGTSTP
-signal when the character is read by the user program.
-Recognized when
-.B IEXTEN
-and
-.B ISIG
-are set, and the system supports
-job control, and then not passed as input.
+.B VSWTCH
+(not in POSIX; not supported under Linux; 0, NUL)
+Switch character (SWTCH).
+Used in System V to switch shells in
+.IR "shell layers" ,
+a predecessor to shell job control.
 .TP
-.B VLNEXT
-(not in POSIX; 026, SYN, Ctrl-V)
-Literal next.
-Quotes the next input character, depriving it of
-a possible special meaning.
-Recognized when
-.B IEXTEN
-is set, and then not passed as input.
+.B VTIME
+Timeout in deciseconds for noncanonical read (TIME).
 .TP
 .B VWERASE
 (not in POSIX; 027, ETB, Ctrl-W)
-Word erase.
-Recognized when
-.B ICANON
-and
-.B IEXTEN
-are set, and then not passed as input.
-.TP
-.B VREPRINT
-(not in POSIX; 022, DC2, Ctrl-R)
-Reprint unread characters.
+Word erase (WERASE).
 Recognized when
 .B ICANON
 and
 .B IEXTEN
 are set, and then not passed as input.
-.TP
-.B VDISCARD
-(not in POSIX; not supported under Linux; 017, SI, Ctrl-O)
-Toggle: start/stop discarding pending output.
-Recognized when
-.B IEXTEN
-is set, and then not passed as input.
-.TP
-.B VSTATUS
-(not in POSIX; not supported under Linux;
-status request: 024, DC4, Ctrl-T).
 .LP
-These symbolic subscript values are all different, except that
+An individual terminal special character can be disabled by setting
+the value of the corresponding
+.I c_cc
+element to
+.BR _POSIX_VDISABLE .
+.LP
+The above symbolic subscript values are all different, except that
 .BR VTIME ,
 .B VMIN
 may have the same value as
@@ -638,7 +648,7 @@ and
 .BR VTIME ,
 see the description of
 noncanonical mode below.
-.SS "Retrieving and changing terminal settings"
+.SS Retrieving and changing terminal settings
 .PP
 .BR tcgetattr ()
 gets the parameters associated with the object referred by \fIfd\fP and
@@ -666,7 +676,7 @@ the change occurs after all output written to the object referred by
 .I fd
 has been transmitted, and all input that has been received but not read
 will be discarded before the change is made.
-.SS "Canonical and noncanonical mode"
+.SS Canonical and noncanonical mode
 The setting of the
 .B ICANON
 canon flag in
@@ -705,6 +715,7 @@ and the remaining characters will be available for a future
 .PP
 In noncanonical mode input is available immediately (without
 the user having to type a line-delimiter character),
+no input processing is performed,
 and line editing is disabled.
 The settings of MIN
 .RI ( c_cc[VMIN] )
@@ -750,7 +761,7 @@ MIN byte have been read,
 or when the inter-byte timeout expires.
 Because the timer is only started after the initial byte
 becomes available, at least one byte will be read.
-.SS "Raw mode"
+.SS Raw mode
 .LP
 .BR cfmakeraw ()
 sets the terminal to something like the
@@ -768,7 +779,7 @@ The terminal attributes are set as follows:
     termios_p\->c_cflag &= ~(CSIZE | PARENB);
     termios_p\->c_cflag |= CS8;
 .fi
-.SS "Line control"
+.SS Line control
 .LP
 .BR tcsendbreak ()
 transmits a continuous stream of zero-valued bits for a specific
@@ -820,7 +831,7 @@ transmitting data to the system.
 .LP
 The default on open of a terminal file is that neither its input nor its
 output is suspended.
-.SS "Line speed"
+.SS Line speed
 The baud rate functions are provided for getting and setting the values
 of the input and output baud rates in the \fItermios\fP structure.
 The new values do not take effect
@@ -892,7 +903,7 @@ is a 4.4BSD extension.
 It takes the same arguments as
 .BR cfsetispeed (),
 and sets both input and output speed.
-.SH "RETURN VALUE"
+.SH RETURN VALUE
 .LP
 .BR cfgetispeed ()
 returns the input baud rate stored in the
@@ -937,7 +948,7 @@ and
 .BR cfsetspeed ()
 are nonstandard, but available on the BSDs.
 .SH NOTES
-Unix V7 and several later systems have a list of baud rates
+UNIX V7 and several later systems have a list of baud rates
 where after the fourteen values B0, ..., B9600 one finds the
 two constants EXTA, EXTB ("External A" and "External B").
 Many systems extend the list with much higher baud rates.
@@ -953,7 +964,7 @@ Linux, AIX, DU, Tru64 send a break of
 milliseconds.
 FreeBSD and NetBSD and HP-UX and MacOS ignore the value of
 .IR duration .
-Under Solaris and Unixware,
+Under Solaris and UnixWare,
 .BR tcsendbreak ()
 with nonzero
 .I duration
@@ -963,7 +974,7 @@ behaves like
 .\" libc4.7.6, libc5, glibc for unix: duration in ms.
 .\" glibc for bsd: duration in us
 .\" glibc for sunos4: ignore duration
-.SH "SEE ALSO"
+.SH SEE ALSO
 .BR stty (1),
 .BR console_ioctl (4),
 .BR tty_ioctl (4),