DataMuseum.dk

Presents historical artifacts from the history of:

ICL Comet 32

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about ICL Comet 32

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦65d95da6d⟧ TextFile

    Length: 29948 (0x74fc)
    Types: TextFile
    Notes: UNIX file
    Names: »tty.4«

Derivation

└─⟦26887b7e0⟧ Bits:30009717 Comet 32 harddisk image
    └─⟦28c352965⟧ »/a« UNIX Filesystem
        └─⟦this⟧ »usr/man/man4/tty.4« 

TextFile

.ig
	@(#)tty.4	2.1	7/1/84
	@(#)Copyright (C) 1983 by National Semiconductor Corp.
..
.de Ul
.ie t \\$1\l'|0\(ul'
.el \fI\\$1\fP
..
.TH TTY 4
.SH NAME
tty \- general terminal interface
.SH DESCRIPTION
This section describes
both a particular special file
.B /dev/tty
and the terminal driver used for conversational computing.
.LP
.B Line disciplines.
.PP
In this version of the system only the new terminal discipline
is supported.
The old and the network drivers are not supported.
The new terminal driver, with features for job control,
must be used when using
.IR csh (1).
See
.IR newtty (1)
for a short user-level summary.
.LP
For compatibility reasons,
line discipline switching with the TIOCSETD 
.I ioctl
is maintained:
.IP
.B "int ldisc = LDISC; ioctl(filedes, TIOCSETD, &ldisc);"
.LP
where LDISC is NTTYDISC for the new driver.
The current line discipline can be obtained with the TIOCGETD ioctl.
.PP
The remainder of this section discusses the
new discipline.
.LP
.B "The control terminal."
.LP
When a terminal file is opened, it causes the process to wait until a
connection is established.  In practice, user programs seldom open
these files; they are opened by
.IR init (8)
and become a user's standard input and output file.
.PP
If a process which has no control terminal opens a terminal file, then
that terminal file becomes the control terminal for that process.
The control terminal is thereafter inherited by a child process during a
.IR fork (2),
even if the control terminal is closed.
.LP
The file
.B /dev/tty
is, in each process, a synonym for a
.I "control terminal"
associated with that process.  It is useful for programs that wish to
be sure of writing messages on the terminal
no matter how output has been redirected.
It can also be used for programs that demand a file name
for output, when typed output is desired
and it is tiresome to find out which terminal
is currently in use.
.LP
.B "Process groups."
.LP
As described more completely in
.IR jobs (3),
command processors such as
.IR csh (1)
can arbitrate the terminal between different
.I jobs
by placing related jobs in a single process group and associating this
process group with the terminal.
A terminal's associated process group
may be set using the TIOCSPGRP
.IR ioctl (2):
.IP
.B "ioctl(fildes, TIOCSPGRP, &pgrp)"
.LP
or examined using TIOCGPGRP rather than TIOCSPGRP, returning the current
process group in
.I pgrp.
The new terminal driver aids in this arbitration by restricting access
to the terminal by processes which are not in the current process group;
see
.B "Job access control"
below.
.LP
.B "Modes."
.PP
The terminal drivers have three major modes, characterized by the
amount of processing on the input and output characters:
.IP cooked 10
The normal mode.  In this mode lines of input are collected and input editing
is done.  The edited line is made available when it is completed by
a newline
or when an EOT (control-D, hereafter ^D)
is entered.
A carriage return is usually made synonymous with newline in this mode,
and replaced with a newline whenever it is typed.
All driver functions
(input editing, interrupt generation,
output processing such as delay generation and tab expansion, etc.)
are available in this mode.
.IP CBREAK 10
This mode eliminates the character, word, and line editing input facilities,
making the input character available to the user program as it is typed.
Flow control,
literal-next,
and interrupt processing are still done in this mode.
Output processing is done.
.IP RAW 10
This mode eliminates all input processing and makes all input characters
available as they are typed; no output processing is done either.
.PP
A process can ask for notification via a SIGTTIN
.IR signal (2)
when input is ready to be read from the control terminal.
In this case a
.IR read (2)
from the control terminal will never block, but rather
return an error indication (EIO) if there is no input available.
.LP
.B "Input editing."
.LP
A UNIX terminal ordinarily operates in full-duplex mode.
Characters may be typed at any time,
even while output is occurring, and are only lost when the
system's character input buffers become completely
choked, which is rare,
or when the user has accumulated the maximum allowed number of
input characters that have not yet been read by some program.
Currently this limit is 256 characters.
When the limit is reached, the new driver simply refuses
to accept any further input, and rings the terminal bell.
.PP
Input characters are normally accepted in either even or odd parity
with the parity bit being stripped off before the character is given to
the program.  By clearing either the EVEN or ODD bit in the flags word
it is possible to have input characters with that parity discarded
(see the
.B Summary
below.)
.PP
It is possible to simulate terminal
input using the TIOCSTI
.IR ioctl ,
which takes, as its third argument,
the address of a character.  The system pretends that this character
was typed on the argument terminal, which must be the control terminal except
for the super-user (this call is not in standard version 7 UNIX).
.PP
Input characters are normally echoed by putting them in an output queue
as they arrive.  This may be disabled by clearing the ECHO bit in the
flags word using the
.IR stty (2)
call or the TIOCSETN or TIOCSETP
.IR ioctl s
(see the
.B Summary
below).
.PP
In cooked mode, terminal input is processed in units of lines.
A program attempting
to read will normally be suspended until an entire line has been
received
(but see the description of SIGTTIN in
.B Modes
above and FIONREAD in
.B Summary
below).
No matter how many characters are requested
in the read call, at most one line will be returned.
It is not, however, necessary to read a whole line at
once; any number of characters may be
requested in a read, even one, without losing information.
.PP
During input, line editing is normally done, with the character `#'
logically erasing the last character typed and the character `@'
logically erasing the entire current input line.
These are often reset on crt's,
with ^H replacing #,
and ^U replacing @.
These characters
never erase beyond the beginning of the current input line or a ^D.
These characters may be entered literally by
preceding them with `\e\|'; the `\e\|' will normally disappear.
.PP
The driver normally treats either a carriage return or a newline character
as terminating an input line, replacing the return with a newline and echoing
a return and a line feed.
If the CRMOD bit is cleared in the local mode word then the processing
for carriage return is disabled, and it is simply echoed as a return,
and does not terminate cooked mode input.
.PP
There is a literal-next character ^V which can be typed
in both cooked and CBREAK mode preceding
.B any
character to prevent its special meaning.  This is to be preferred to the
use of `\e\|' escaping erase and kill characters, but `\e\|' is
(at least temporarily)
retained with its old function in the new driver for historical reasons.
.PP
The new terminal driver also provides two other editing characters in
normal mode.  The word-erase character, normally ^W, erases the preceding
word, but not any spaces before it.  For the purposes of ^W, a word
is defined as a sequence of non-blank characters, with tabs counted as
blanks.
Finally,
the reprint character,
normally ^R,
retypes the pending input beginning
on a new line.  Retyping occurs automagically in cooked mode if characters
which would normally be erased from the screen are fouled by program output.
.LP
.B "Input echoing and redisplay"
.LP
The new terminal driver has several modes for handling the echoing of
terminal input, controlled by bits in a local mode word.
.LP
.I "Hardcopy terminals."
When a hardcopy terminal is in use, the LPRTERA bit is normally set in
the local mode word.  Characters which are logically erased are
then printed out backwards preceded by `\e\|' and followed by `/' in this mode.
.LP
.I "Crt terminals."
When a crt terminal is in use, the LCRTBS bit is normally set in the local
mode word.  The terminal driver then echoes the proper number of erase
characters when input is erased; in the normal case where the erase
character is a ^H this causes the cursor of the terminal to back up
to where it was before the logically erased character was typed.
If the input has become fouled due to interspersed asynchronous output,
the input is automagically retyped.
.LP
.I "Erasing characters from a crt."
When a crt terminal is in use, the LCRTERA bit may be set to cause
input to be erased from the screen with a \*(lqbackspace-space-backspace\*(rq
sequence when character or word deleting sequences are used.
A LCRTKIL bit may be set as well, causing the input to
be erased in this manner on line kill sequences as well.
.LP
.I "Echoing of control characters."
If the LCTLECH bit is set in the local state word, then non-printing (control)
characters are normally echoed as ^X (for some X)
rather than being echoed unmodified; delete is echoed as ^?.
.LP
The normal modes for using the new terminal driver on crt terminals
are speed dependent.
At speeds less than 1200 baud, the LCRTERA and LCRTKILL processing
is painfully slow, so 
.IR stty (1)
normally just sets LCRTBS and LCTLECH; at
speeds of 1200 baud or greater all of these bits are normally set.
.IR Stty (1)
summarizes these option settings and the use of the new terminal
driver as
\*(lqnewcrt.\*(rq
.LP
.B "Output processing."
.PP
When one or more
characters are written, they are actually transmitted
to the terminal as soon as previously-written characters
have finished typing.
(As noted above, input characters are normally 
echoed by putting them in the output queue
as they arrive.)
When a process produces characters more rapidly than they can be typed,
it will be suspended when its output queue exceeds some limit.
When the queue has drained down to some threshold
the program is resumed.
Even parity is normally generated on output.
The EOT character is not transmitted in cooked mode to prevent terminals
that respond to it from hanging up; programs using RAW or CBREAK mode
should be careful.
.PP
The terminal drivers provide necessary processing for cooked and CBREAK mode
output including delay generation for certain special characters and parity
generation.
Delays are available after backspaces ^H,
form feeds ^L,
carriage returns ^M,
tabs ^I,
and newlines ^J.
The driver will also optionally
expand tabs into spaces, where the tab stops are assumed to be set every
eight columns.  These functions are controlled by bits in the tty flags word;
see
.B Summary
below.
.PP
The terminal drivers provide for mapping between upper and lower case
on terminals lacking lower case, and for other special processing on
deficient terminals.
.PP
Finally,
in the new terminal driver,
there is a output flush character,
normally ^O, which sets the LFLUSHO bit in the local mode word, causing
subsequent output to be flushed until it is cleared by a program or more
input is typed.  This character has effect in both cooked and CBREAK modes
and causes pending input to be retyped if there is any pending input.
.IR Ioctl s
to flush the characters in the input and output queues TIOCFLUSH,
and to return the number of character still in the output queue
TIOCOUTQ are also available.
.LP
.B "Upper case terminals"
.PP
If the LCASE bit is set in the tty flags, then
all upper-case letters are mapped into
the corresponding lower-case letter.
The upper-case letter may be generated by preceding
it by `\\'.
Upper case letters are preceded by a `\e\|' when output.
In addition, the following escape sequences can be generated
on output and accepted on input:
.PP
.nf
for	`	|	~	{	}
use	\e\'	\e\|!	\e\|^	\e\|(	\e\|)
.fi
.ig Xx
'\"	We don't support the Hazeltine hack -- i.e., no LTILDE
.PP
To deal with Hazeltine terminals, which do not understand that ~ has
been made into an ASCII character, the LTILDE bit may be set in the local
mode word when using the new terminal driver; in this case the character
~ will be replaced with the character \` on output.
'\"	end of ignored Hazeltine hack text
.Xx
.LP
.B "Flow control."
.PP
There are two characters (the stop character, normally ^S, and the
start character, normally ^Q) which cause output to be suspended and
resumed respectively.  Extra stop characters typed when output
is already stopped have no effect, unless the start and stop characters
are made the same, in which case output resumes.
.PP
A bit in the flags word may be set to put the terminal into TANDEM mode.
In this mode the system produces a stop character (default ^S) when
the input queue is in danger of overflowing, and a start character (default
^Q) when the input has drained sufficiently.  This mode is useful
when the terminal is actually another machine that obeys the
conventions.
.LP
.B "Line control and breaks."
.LP
There are several
.I ioctl
calls available to control the state of the terminal line.
The TIOCSBRK
.I ioctl
will set the break bit in the hardware interface
causing a break condition to exist; this can be cleared (usually after a delay
with
.IR sleep (3))
by TIOCCBRK.
Break conditions in the input are reflected as a null character in RAW mode
or as the interrupt character in cooked or CBREAK mode.
The TIOCCDTR
.I ioctl
will clear the data terminal ready condition;
it can be set again by TIOCSDTR.
.PP
When the carrier signal from the dataset drops (usually
because the user has hung up his terminal) a
SIGHUP hangup signal is sent to the processes in the distinguished
process group of the terminal; this usually causes them to terminate
(the SIGHUP can be suppressed by setting the LNOHANG bit in the local
state word of the driver.)
Access to the terminal by other processes is then normally revoked,
so any further reads will fail, and programs that read a terminal and test for
end-of-file on their input will terminate appropriately.
.PP
When using an ACU
it is possible to ask that the phone line be hung up on the last close
with the TIOCHPCL
.IR ioctl ;
this is normally done on the outgoing line.
.LP
.B "Interrupt characters."
.PP
There are several characters that generate interrupts in cooked and CBREAK
mode; all are sent the processes in the control group of the terminal,
as if a TIOCGPGRP ioctl were done to get the process group and then a
.IR killpg (2)
system call were done,
except that these characters also flush pending input and output when
typed at a terminal
(\fI\z'a\`'la\fR TIOCFLUSH).
The characters shown here are the defaults; the field names in the structures
(given below)
are also shown.
The characters may be changed,
although this is not often done.
.IP ^?
.B t_intrc
(Delete) generates a SIGINTR signal.
This is the normal way to stop a process 
or to regain control in an interactive program.
.IP ^\e
.B t_quitc
(FS) generates a SIGQUIT signal.
This is used to cause a program to terminate and produce a core image,
if possible,
in the file
.B core
in the current directory.
.IP ^Z
.B t_suspc
(EM) generates a SIGTSTP signal, which is used to suspend
the current process group.
.IP ^Y
.B t_dstopc
(SUB) generates a SIGTSTP signal as ^Z does, but the
signal is sent when a program attempts to read the ^Y, rather than when
it is typed.
.LP
.B "Job access control."
.PP
If a process which is not in the distinguished process group of its
control terminal attempts to read from that terminal,
its process group is
sent a SIGTTIN signal, which normally causes the members of that process group
to stop.  If, however, the process is ignoring or holding SIGTTIN signal
is an orphan
.RI ( i.e.
its parent has exited and it has been inherited by the
.IR init (8)
process, or if it is a process in the middle of process creation using
.IR vfork (2)),
it is instead returned an end-of-file.  Under older UNIX systems
these processes would typically have had their input files reset to
.BR /dev/null ,
so this is a compatible change.
.PP
When using the new terminal driver with the LTOSTOP bit set in the local
modes, a process is prohibited from writing on its control terminal if it is
not in the distinguished process group for that terminal.
Processes which are holding or ignoring SIGTTOU signals, which are 
orphans, or which are in the middle of a
.IR vfork (2)
are excepted and allowed to produce output.
.LP
.B "Obtaining information about the current process."
.PP
The GENIX terminal driver provides a way to obtain information about the
current process running on the terminal.
When the info character is typed
(usually ^T),
the kernel types a line of status about a process.
The status is generated at interrupt level,
and so appears immediately.
The output is similar to the following:
.IP \&
load 2 pid 447 (csh) pc F506 mem 81/82 cpu 2:10.2 tty wait
.PP
Load is the instantaneous load average
(the number of processes in the run queue).
Pid is the process which is currently executing,
or which last executed in the current process group
(therefore only foreground processes can be examined).
The name inside of parenthesis is the program name.
Pc is the current user mode PC of the process
(even if the process is executing in the kernel).
Mem describes the current size of the process,
and consists of two numbers.
The first number is the resident size of the process in pages
(1024 bytes).
The second number is the total size of the process
(the number of pages which are in use,
whether or not they are in memory).
Cpu is the total runtime of the process in minutes,
seconds,
and tenths of seconds
(the time includes system time).
The last information is the state of the process.
Various messages can appear here,
such as: \*(lqrun\*(rq (on the run queue),
\*(lqrunning\*(rq (running right now),
\*(lqtty wait\*(rq (waiting for the controlling terminal),
\*(lqpause\*(rq (waiting indefinitely),
\*(lqsleep\*(rq (interruptable io wait),
\*(lqio wait\*(rq (uninterruptable short term wait,
usually for the disk),
\*(lqstopped\*(rq (stopped by job control,
or being ptraced),
\*(lqcreated" (being initialized),
and \*(lqzombie\*(rq (processes exiting).
In addition,
\*(lqswapped\*(rq can appear when the process is not loaded into memory.
.PP
If no process is found in the terminal process group,
then only the load average is given,
along with the message \*(lqno current process.\*(rq
This information feature is disabled in RAW mode.
.LP
.B "Summary of modes."
.LP
Unfortunately, due to the evolution of the terminal driver,
there are four different structures that contain various portions of the
driver data.
The first of these
.RB ( sgttyb )
contains that part of the information
largely common between version 6 and version 7 UNIX systems.
The second contains additional control characters added in version 7.
The third is a word of local state peculiar to the new terminal driver,
and the fourth is another structure of special characters added for the
new driver.  In the future a single structure may be made available
to programs which need to access all this information; most programs
need not concern themselves with all this state.
.LP
.Ul "Basic modes: sgtty."
.PP
The basic
.IR ioctl s
use the structure
defined in
.IR <sgtty.h> :
.PP
.ta .5i 1i
.nf
.ft 3
struct sgttyb {
	char	sg_ispeed;
	char	sg_ospeed;
	char	sg_erase;
	char	sg_kill;
	short	sg_flags;
};
.ft R
.fi
.PP
The
.I sg_ispeed 
and 
.I sg_ospeed
fields describe the input and output speeds of the
device according to the following table,
which corresponds to the DEC DH-11 interface.
If other hardware is used,
impossible speed changes are ignored.
Symbolic values in the table are as defined in
.IR <sgtty.h> .
.PP
.nf
.ta \w'B9600   'u +5n
B0	0	(hang up dataphone)
B50	1	50 baud
B75	2	75 baud
B110	3	110 baud
B134	4	134.5 baud
B150	5	150 baud
B200	6	200 baud
B300	7	300 baud
B600	8	600 baud
B1200	9	1200 baud
B1800	10	1800 baud
B2400	11	2400 baud
B4800	12	4800 baud
B9600	13	9600 baud
EXTA	14	External A
EXTB	15	External B
.fi
.DT
.PP
In the current configuration,
only 110, 150, 300 and 1200 baud are really supported on dial-up lines.
Code conversion and line control required for
IBM 2741's (134.5 baud)
must be implemented by the user's
program.
The half-duplex line discipline
required for the 202 dataset (1200 baud)
is not supplied; full-duplex 212 datasets work fine.
.PP
The
.I sg_erase
and
.I sg_kill
fields of the argument structure
specify the erase and kill characters respectively.
(Defaults are # and @.)
.PP
The
.I sg_flags
field of the argument structure
contains several bits that determine the
system's treatment of the terminal:
.PP
.ta \w'ALLDELAY 'u +\w'0100000 'u
.nf
ALLDELAY	0177400	Delay algorithm selection
BSDELAY	0100000	Select backspace delays (not implemented):
BS0	0
BS1	0100000
VTDELAY	0040000	Select form-feed and vertical-tab delays:
FF0	0
FF1	0100000
CRDELAY	0030000	Select carriage-return delays:
CR0	0
CR1	0010000
CR2	0020000
CR3	0030000
TBDELAY	0006000	Select tab delays:
TAB0	0
TAB1	0001000
TAB2	0004000
XTABS	0006000
NLDELAY	0001400	Select new-line delays:
NL0	0
NL1	0000400
NL2	0001000
NL3	0001400
EVENP	0000200	Even parity allowed on input (most terminals)
ODDP	0000100	Odd parity allowed on input
RAW	0000040	Raw mode: wake up on all characters, 8-bit interface
CRMOD	0000020	Map CR into LF; echo LF or CR as CR-LF
ECHO	0000010	Echo (full duplex)
LCASE	0000004	Map upper case to lower on input
CBREAK	0000002	Return each character as soon as typed
TANDEM	0000001	Automatic flow control
.DT
.fi
.PP
The delay bits specify how long
transmission stops to allow for mechanical or other movement
when certain characters are sent to the terminal.
In all cases a value of 0 indicates no delay.
.PP
Backspace delays are currently ignored but might
be used for Terminet 300's.
.PP
If a form-feed/vertical tab delay is specified,
it lasts for about 2 seconds.
.PP
Carriage-return delay type 1 lasts about .08 seconds
and is suitable for the Terminet 300.
Delay type 2 lasts about .16 seconds and is suitable
for the VT05 and the TI 700.
Delay type 3 is suitable for the concept-100 and pads lines
to be at least 9 characters at 9600 baud.
.PP
New-line delay type 1 is dependent on the current column
and is tuned for Teletype model 37's.
Type 2 is useful for the VT05 and is about .10 seconds.
Type 3 is unimplemented and is 0.
.PP
Tab delay type 1 is dependent on the amount of movement
and is tuned to the Teletype model
37.
Type 3, called XTABS,
is not a delay at all but causes tabs to be replaced
by the appropriate number of spaces on output.
.PP
Input characters with the wrong parity, as determined by bits 200 and
100, are ignored in cooked and CBREAK mode.
.PP
RAW
disables all processing save output flushing with LFLUSHO;
a full 8 bits of input are given as soon as
it is available; all 8 bits are passed on output.
A break condition in the input is reported as a null character.
If the input queue overflows in RAW mode it is discarded;
this applies to both new and old drivers.
.PP
CRMOD causes input carriage returns to be turned into
new-lines;
input of either CR or LF causes LF-CR both to
be echoed
(for terminals with a new-line function).
.PP
CBREAK is a sort of half-cooked (rare?) mode.
Programs can read each character as soon as typed, instead
of waiting for a full line;
all processing is done except the input editing:
character and word erase and line kill, input reprint,
and the special treatment of \e or EOT are disabled.
.PP
TANDEM mode causes the system to produce
a stop character (default ^S) whenever the input
queue is in danger of overflowing, and a start character
(default ^Q)
when the input queue has drained sufficiently.
It is useful for flow control when the `terminal'
is really another computer which understands the conventions.
.LP
.Ul "Basic ioctls"
.PP
In addition to the TIOCSETD and TIOCGETD disciplines discussed in
.B "Line disciplines"
above,
a large number of other
.IR ioctl (2)
calls apply to terminals, and have the general form:
.PP
.B #include <sgtty.h>
.PP
.B ioctl(fildes, code, arg)
.br
.B struct sgttyb *arg;
.PP
The applicable codes are:
.IP TIOCGETP 15
Fetch the basic parameters associated with the terminal,
and store in the pointed-to
.I sgttyb
structure.
.IP TIOCSETP
Set the parameters according to the pointed-to
.I sgttyb
structure.
The interface delays until output is quiescent,
then throws away any unread characters,
before changing the modes.
.IP TIOCSETN
Set the parameters like TIOCSETP but do not delay or flush input.
Input is not preserved, however, when changing to or from RAW.
.PP
With the following codes the
.I arg
is ignored.
.IP TIOCEXCL 15
Set \*(lqexclusive-use\*(rq mode:
no further opens are permitted until the file has been closed.
.IP TIOCNXCL
Turn off \*(lqexclusive-use\*(rq mode.
.IP TIOCHPCL
When the file is closed for the last time,
hang up the terminal.
This is useful when the line is associated
with an ACU used to place outgoing calls.
.IP TIOCFLUSH
All characters waiting in input or output queues are flushed.
.LP
The remaining calls are not available in vanilla version 7 UNIX.
In cases where arguments are required, they are described;
.I arg
should otherwise be given as 0.
.IP TIOCSTI 15
the argument is the address of a character which the system
pretends was typed on the terminal.
.IP TIOCSBRK 15
the break bit is set in the terminal.
.IP TIOCCBRK
the break bit is cleared.
.IP TIOCSDTR 
data terminal ready is set.
.IP TIOCCDTR
data terminal ready is cleared.
.IP TIOCGPGRP
.I arg
is the address of a word into which is placed the process group
number of the control terminal.
.IP TIOCSPGRP
.I arg
is a word (typically a process id) which becomes the process
group for the control terminal.
.IP FIONREAD
returns in the long integer whose address is
.I arg
the number
of immediately readable characters from the argument unit.
This works for files,
pipes,
and terminals.
.LP
.Ul Tchars
.PP
The second structure associated with each terminal specifies
characters that are special in both the old and new terminal interfaces:
The following structure is defined in
.IR <sys/ioctl.h> ,
which is automatically included in
.IR <sgtty.h> :
.PP
.nf
.ft 3
.ta .5i 1i 2i 
struct tchars {
	char	t_intrc;	/* interrupt */
	char	t_quitc;	/* quit */
	char	t_startc;	/* start output */
	char	t_stopc;	/* stop output */
	char	t_eofc;		/* end-of-file */
	char	t_brkc;		/* input delimiter (like nl) */
};
.DT
.fi
.ft R
.PP
The default values for these characters are
^?, ^\e\|, ^Q, ^S, ^D, and \-1.
A character value of \-1
eliminates the effect of that character.
The
.I t_brkc
character, by default \-1,
acts like a new-line in that it terminates a `line,'
is echoed, and is passed to the program.
The `stop' and `start' characters may be the same,
to produce a toggle effect.
It is probably counterproductive to make
other special characters (including erase and kill)
identical.
The applicable
.I ioctl
calls are:
.IP TIOCGETC 12
Get the special characters and put them in the specified structure.
.IP TIOCSETC 12
Set the special characters to those given in the structure.
.LP
.Ul "Local mode"
.PP
The third structure associated with each terminal is a local mode word;
except for the LNOHANG bit, this word is interpreted only when the new
driver is in use.
The bits of the local mode word are:
.sp
.nf
LCRTBS	000001	Backspace on erase rather than echoing erase
LPRTERA	000002	Printing terminal erase mode
LCRTERA	000004	Erase character echoes as backspace-space-backspace
LTILDE	000010	Convert ~ to ` on output (for Hazeltine terminals) (not supported)
LMDMBUF	000020	Stop/start output when carrier drops
LLITOUT	000040	Suppress output translations
LTOSTOP	000100	Send SIGTTOU for background output
LFLUSHO	000200	Output is being flushed
LNOHANG	000400	Don't send hangup when carrier drops
LETXACK	001000	Diablo style buffer hacking (unimplemented)
LCRTKIL	002000	BS-space-BS erase entire line on line kill
LINTRUP	004000	Generate interrupt SIGTINT when input ready to read
LCTLECH	010000	Echo input control chars as ^X, delete as ^?
LPENDIN	020000	Retype pending input at next read or input character
LDECCTQ	040000	Only ^Q restarts output after ^S, like DEC systems
.fi
.sp
The applicable
.I ioctl
functions are:
.IP TIOCLBIS 15
.I arg
is the address of a 
mask which is the bits to be set in the local mode word.
.IP TIOCLBIC
.I arg
is the address of a mask of bits to be cleared in the local mode word.
.IP TIOCLSET
.I arg
is the address of a mask to be placed in the local mode word.
.IP TIOCLGET
.I arg
is the address of a word into which the current mask is placed.
.LP
.Ul "Local special chars"
.PP
The
final structure associated with each terminal is the
.I ltchars
structure which defines interrupt characters
for the new terminal driver.
Its structure is:
.nf
.sp
.ta .5i 1i 2i
.ft 3
struct ltchars {
	char	t_suspc;	/* stop process signal */
	char	t_dstopc;	/* delayed stop process signal */
	char	t_rprntc;	/* reprint line */
	char	t_flushc;	/* flush output (toggles) */
	char	t_werasec;	/* word erase */
	char	t_lnextc;	/* literal next character */
	char	t_infoc;	/* type information character */
};
.ft 1
.fi
.sp
The default values for these characters are ^Z, ^Y, ^R, ^O, ^W, ^V, and ^T.
A value of \-1 disables the character.
.PP
.BR N.B. :
The
.I t_infoc
field is not present in standard 4.1bsd systems
and is a GENIX enhancement.
Programs making use of this feature
that are intended to run on other 4.1 systems
should use conditional compilation
to isolate code dealing specifically with
.IR t_infoc .
.PP
The applicable
.I ioctl
functions are:
.IP TIOCSLTC 12
.I arg
is the address of a 
.I ltchars
structure which defines the new local special characters.
.IP TIOCGLTC 12
.I arg
is the address of a
.I ltchars
structure into which is placed the current set of local special characters.
.SH FILES
/dev/tty
.br
/dev/tty*
.br
/dev/console
.SH SEE ALSO
csh(1), stty(1),
ioctl(2), signal(2), sigsys(2), stty(2),
getty(8), init(8), newtty(4)
.SH BUGS
Half-duplex terminals are not supported.