Bell 32V development
[unix-history] / usr / man / man2 / stty.2
CommitLineData
dd9fbdf8
TL
1.TH STTY 2
2.SH NAME
3stty, gtty \- set and retrieve terminal modes
4.SH SYNOPSIS
5.B #include <sgtty.h>
6.PP
7.B stty(fildes, arg)
8.br
9.B struct sgttyb *arg;
10.PP
11.B gtty(fildes, arg)
12.br
13.B struct sgttyb *arg;
14.SH DESCRIPTION
15.I Gtty
16stores in the structure pointed to by
17.I arg
18status information about the terminal
19whose file descriptor is in r0 (in the first argument).
20.PP
21.I Stty
22delays until the terminal is quiescent,
23then sets its status to agree with the structure
24pointed to by
25.IR arg .
26.PP
27The input and output speeds are set from the first two bytes
28Both system calls use the structure
29defined in <sgtty.h>:
30.PP
31.nf
32struct sgttyb {
33 char sg_ispeed;
34 char sg_ospeed;
35 char sg_erase;
36 char sg_kill;
37 int sg_flags;
38};
39.fi
40.PP
41The
42.I sg_ispeed
43and
44.I sg_ospeed
45fields describe the input and output speeds of the
46device according to the following table,
47which corresponds to the DH-11 interface.
48If DC-11, DL-11 or KL-11 interfaces are used,
49impossible speed changes are ignored.
50Symbolic values in the table are as defined in
51.IR <sgtty.h> .
52.PP
53.nf
54.ta \w'B9600 'u +5n
55B0 0 (hang up dataphone)
56B50 1 50 baud
57B75 2 75 baud
58B110 3 110 baud
59B134 4 134.5 baud
60B150 5 150 baud
61B200 6 200 baud
62B300 7 300 baud
63B600 8 600 baud
64B1200 9 1200 baud
65B1800 10 1800 baud
66B2400 11 2400 baud
67B4800 12 4800 baud
68B9600 13 9600 baud
69EXTA 14 External A
70EXTB 15 External B
71.fi
72.DT
73.PP
74In the current configuration,
75only 110, 150, 300 and 1200 baud are really supported on dial-up lines.
76Code conversion and line control required for
77IBM 2741's (134.5 baud)
78must be implemented by the user's
79program.
80The half-duplex line discipline
81required for the 202 dataset (1200 baud)
82is not supplied; full-duplex 212 datasets work fine.
83.PP
84The
85.I sg_erase
86and
87.I sg_kill
88fields of the argument structure
89specify the erase and kill characters respectively.
90(Defaults are # and @.)
91.PP
92The
93.I sg_flags
94field of the argument structure
95contains several bits which determine the
96system's treatment of the terminal:
97.PP
98.ta \w'ALLDELAY 'u +\w'0100000 'u
99.nf
100ALLDELAY 0177400 Delay algorithm selection
101BSDELAY 0100000 Select backspace delays:
102BS0 0
103BS1 0100000
104VTDELAY 0040000 Select form-feed and vertical-tab delays:
105FF0 0
106FF1 0040000
107CRDELAY 0030000 Select carriage-return delays:
108CR0 0
109CR1 0010000
110CR2 0020000
111CR3 0030000
112TBDELAY 0006000 Select tab delays:
113TAB0 0
114TAB1 0002000
115TAB2 0004000
116TAB3 0006000
117NLDELAY 0001400 Select new-line delays:
118NL0 0
119NL1 0000400
120NL2 0001000
121NL3 0001400
122EVENP 0000200 Even parity allowed on input (e. g. for M37s)
123ODDP 0000100 Odd parity allowed on input
124RAW 0000040 Raw mode: wake up on all characters
125CRMOD 0000020 Map CR into LF; echo LF or CR as CR-LF
126ECHO 0000010 Echo (full duplex)
127LCASE 0000004 Map upper case to lower on input (e. g. M33)
128CBREAK 0000002 Return each character as soon as typed
129HUPCL 0000001 Hang up (remove `data terminal ready') on last close
130.DT
131.fi
132.PP
133The delay bits specify how long
134transmission stops to allow for mechanical or other movement
135when certain characters are sent to the terminal.
136In all cases a value of 0 indicates no delay.
137.PP
138Backspace delays are currently ignored but will
139be used for Terminet 300's.
140.PP
141If a form-feed/vertical tab delay is specified,
142it lasts for about 2 seconds.
143.PP
144Carriage-return delay type 1 lasts about .08 seconds
145and is suitable for the Terminet 300.
146Delay type 2 lasts about .16 seconds and is suitable
147for the VT05 and the TI 700.
148Delay type 3 is unimplemented and is 0.
149.PP
150New-line delay type 1 is dependent on the current column
151and is tuned for Teletype model 37's.
152Type 2 is useful for the VT05 and is about .10 seconds.
153Type 3 is unimplemented and is 0.
154.PP
155Tab delay type 1 is dependent on the amount of movement
156and is tuned to the Teletype model
15737.
158Other types are unimplemented and are 0.
159.PP
160Characters with the wrong parity, as determined by bits 200 and
161100, are ignored.
162.PP
163In raw mode, every character is passed immediately
164to the program without waiting until a full line has been typed.
165No erase or kill processing is done;
166the end-of-file character (EOT), the interrupt character
167(DEL) and the quit character (FS) are not treated specially.
168.PP
169Mode 020 causes input carriage returns to be turned into
170new-lines;
171input of either CR or LF causes LF-CR both to
172be echoed
173(used for GE TermiNet 300's and other terminals without the newline function).
174.PP
175The hangup mode 01
176causes the line to be disconnected
177when the last process with the line open closes it or terminates.
178It is useful when a port is to be used for some special
179purpose;
180for example, if it is associated
181with an ACU used to place outgoing calls.
182.PP
183This system call is also used with certain special
184files other than terminals,
185but since none of them are part of the standard system
186the specifications will not be given.
187.SH "SEE ALSO"
188stty(1), tty(4)
189.SH DIAGNOSTICS
190Zero is returned if the call was successful;
191\-1 if the file descriptor does not refer to a terminal.
192.SH "ASSEMBLER (PDP-11)"
193(stty = 31.)
194.br
195(file descriptor in r0)
196.br
197.B sys stty; arg
198.PP
199(gtty = 32.)
200.br
201(file descriptor in r0)
202.B sys gtty; arg