1termios.h(3HEAD) Headers termios.h(3HEAD)
2
3
4
6 termios.h, termios - define values for termios
7
9 #include <termios.h>
10
11
13 The <termios.h> header contains the definitions used by the terminal
14 I/O interfaces. See termios(3C) and termio(7I) for an overview of the
15 terminal interface.
16
17 The termios Structure
18 The following data types are defined through typedef:
19
20 cc_t used for terminal special characters
21
22
23 speed_t used for terminal baud rates
24
25
26 tcflag_t used for terminal modes
27
28
29
30 The above types are all unsigned integer types.
31
32
33 The implementation supports one or more programming environments in
34 which the widths of cc_t, speed_t, and tcflag_t are no greater than the
35 width of type long. The names of these programming environments can be
36 obtained using the confstr(3C) function or the getconf(1) utility.
37
38
39 The termios structure is defined and includes the following members:
40
41 tcflag_t c_iflag /* input modes */
42 tcflag_t c_oflag /* output modes */
43 tcflag_t c_cflag /* control modes */
44 tcflag_t c_lflag /* local modes */
45 cc_t c_cc[NCCS] /* control characters */
46
47
48
49 A definition is provided for:
50
51 NCCS size of the array c_cc for control characters
52
53
54
55 The following subscript names for the array c_cc are defined:
56
57
58
59
60 Subscript UsageCanonical Mode Subscript UsageNon-Canonical Mode Description
61 ──────────────────────────────────────────────────────────────────────────────────────────
62 VEOF EOF character
63 VEOL EOL character
64 VERASE ERASE character
65 VINTR VINTR INTR character
66
67 VKILL KILL character
68 VMIN MIN value
69 VQUIT VQUIT QUIT character
70 VSTART VSTART START character
71 VSTOP VSTOP STOP character
72 VSUSP VSUSP SUSP character
73 VTIME TIME value
74
75
76
77 The subscript values are unique, except that the VMIN and VTIME sub‐
78 scripts can have the same values as the VEOF and VEOL subscripts,
79 respectively.
80
81
82 The header file provides the flags described below.
83
84 Input Modes
85 The c_iflag field describes the basic terminal input control:
86
87 BRKINT Signal interrupt on break.
88
89
90 ICRNL Map CR to NL on input.
91
92
93 IGNBRK Ignore break condition.
94
95
96 IGNCR Ignore CR.
97
98
99 IGNPAR Ignore characters with parity errors.
100
101
102 INLCR Map NL to CR on input.
103
104
105 INPCK Enable input parity check.
106
107
108 ISTRIP Strip character.
109
110
111 IXANY Enable any character to restart output.
112
113
114 IXOFF Enable start/stop input control.
115
116
117 IXON Enable start/stop output control.
118
119
120 PARMRK Mark parity errors.
121
122
123 Output Modes
124 The c_oflag field specifies the system treatment of output:
125
126 OPOST Post-process output.
127
128
129 ONLCR Map NL to CR-NL on output.
130
131
132 OCRNL Map CR to NL on output.
133
134
135 ONOCR No CR output at column 0.
136
137
138 ONLRET NL performs CR function.
139
140
141 OFILL Use fill characters for delay.
142
143
144 NLDLY Select newline delays:
145
146 NL0 newline type 0
147
148
149 NL1 newline type 1
150
151
152
153 CRDLY Select carriage-return delays:
154
155 CR0 carriage-return delay type 0
156
157
158 CR1 carriage-return delay type 1
159
160
161 CR2 carriage-return delay type 2
162
163
164 CR3 carriage-return delay type 3
165
166
167
168 TABDLY Select horizontal-tab delays:
169
170 TAB0 horizontal-tab delay type 0
171
172
173 TAB1 horizontal-tab delay type 1
174
175
176 TAB2 horizontal-tab delay type 2
177
178
179 TAB3 expand tabs to spaces
180
181
182
183 BSDLY Select backspace delays:
184
185 BS0 backspace-delay type 0
186
187
188 BS1 backspace-delay type 1
189
190
191
192 VTDLY Select vertical-tab delays:
193
194 VT0 vertical-tab delay type 0
195
196
197 VT1 vertical-tab delay type 1
198
199
200
201 FFDLY Select form-feed delays:
202
203 FF0 form-feed delay type 0
204
205
206 FF1 form-feed delay type 1
207
208
209
210 Baud Rate Selection
211 The input and output baud rates are stored in the termios structure.
212 These are the valid values for objects of type speed_ t. The following
213 values are defined, but not all baud rates need be supported by the
214 underlying hardware.
215
216 B0 Hang up
217
218
219 B50 50 baud
220
221
222 B75 75 baud
223
224
225 B110 110 baud
226
227
228 B134 134.5 baud
229
230
231 B150 150 baud
232
233
234 B200 200 baud
235
236
237 B300 300 baud
238
239
240 B600 600 baud
241
242
243 B1200 1 200 baud
244
245
246 B1800 1 800 baud
247
248
249 B2400 2 400 baud
250
251
252 B4800 4 800 baud
253
254
255 B9600 9 600 baud
256
257
258 B19200 19 200 baud
259
260
261 B38400 38 400 baud
262
263
264 Control Modes
265 The c_cflag field describes the hardware control of the terminal; not
266 all values specified are required to be supported by the underlying
267 hardware:
268
269 CSIZE Character size:
270
271 CS5 5 bits
272
273
274 CS6 6 bits
275
276
277 CS7 7 bits
278
279
280 CS8 8 bits
281
282
283
284 CSTOPB Send two stop bits, else one.
285
286
287 CREAD Enable receiver.
288
289
290 PARENB Parity enable.
291
292
293 PARODD Odd parity, else even.
294
295
296 HUPCL Hang up on last close.
297
298
299 CLOCAL Ignore modem status lines.
300
301
302
303 The implementation supports the functionality associated with the sym‐
304 bols CS7, CS8, CSTOPB, PARODD, and PARENB.
305
306 Local Modes
307 The c_lflag field of the argument structure is used to control various
308 terminal functions:
309
310 ECHO Enable echo.
311
312
313 ECHOE Echo erase character as error-correcting backspace.
314
315
316 ECHOK Echo KILL.
317
318
319 ECHONL Echo NL.
320
321
322 ICANON Canonical input (erase and kill processing).
323
324
325 IEXTEN Enable extended input character processing.
326
327
328 ISIG Enable signals.
329
330
331 NOFLSH Disable flush after interrupt or quit.
332
333
334 TOSTOP Send SIGTTOU for background output.
335
336
337 Attribute Selection
338 The following symbolic constants for use with tcsetattr() are defined:
339
340 TCSANOW Change attributes immediately.
341
342
343 TCSADRAIN Change attributes when output has drained.
344
345
346 TCSAFLUSH Change attributes when output has drained; also flush
347 pending input.
348
349
350 Line Control
351 The following symbolic constants for use with tcflush() are defined:
352
353 TCIFLUSH Flush pending input.
354
355
356 TCIOFLUSH Flush both pending input and untransmitted output.
357
358
359 TCOFLUSH Flush untransmitted output.
360
361
362
363 The following symbolic constants for use with tcflow() are defined:
364
365 TCIOFF Transmit a STOP character, intended to suspend input data.
366
367
368 TCION Transmit a START character, intended to restart input data.
369
370
371 TCOOFF Suspend output.
372
373
374 TCOON Restart output.
375
376
378 See attributes(5) for descriptions of the following attributes:
379
380
381
382
383 ┌─────────────────────────────┬─────────────────────────────┐
384 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
385 ├─────────────────────────────┼─────────────────────────────┤
386 │Interface Stability │Standard │
387 └─────────────────────────────┴─────────────────────────────┘
388
390 getconf(1), cfgetispeed(3C), cfsetispeed(3C), confstr(3C), tcdrain(3C),
391 tcflow(3C), tcflush(3C), tcgetattr(3C), tcgetsid(3C), tcsendbreak(3C),
392 tcsetattr(3C), attributes(5), standards(5)
393
394
395
396SunOS 5.11 10 Sep 2004 termios.h(3HEAD)