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