File: termios.h.0p

package info (click to toggle)
manpages-posix 1.67-3
  • links: PTS
  • area: non-free
  • in suites: sarge
  • size: 9,564 kB
  • ctags: 6
  • sloc: makefile: 69; sh: 37
file content (492 lines) | stat: -rw-r--r-- 8,621 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved 
.TH "<termios.h>" P 2003 POSIX
.\" <termios.h> 
.SH NAME
termios.h \- define values for termios
.SH SYNOPSIS
.LP
\fB#include <termios.h>\fP
.SH DESCRIPTION
.LP
The \fI<termios.h>\fP header contains the definitions used by the
terminal I/O interfaces (see \fIGeneral Terminal Interface\fP for
the structures and names defined).
.SS The termios Structure
.LP
The following data types shall be defined through \fBtypedef\fP:
.TP 7
\fBcc_t\fP
Used for terminal special characters.
.TP 7
\fBspeed_t\fP
Used for terminal baud rates.
.TP 7
\fBtcflag_t\fP
Used for terminal modes.
.sp
.LP
The above types shall be all unsigned integer types.
.LP
The implementation shall support one or more programming environments
in which the widths of \fBcc_t\fP, \fBspeed_t\fP, and
\fBtcflag_t\fP are no greater than the width of type \fBlong\fP. The
names of these programming environments can be obtained
using the \fIconfstr\fP() function or the \fIgetconf\fP utility.
.LP
The \fBtermios\fP structure shall be defined, and shall include at
least the following members:
.sp
.RS
.nf

\fBtcflag_t  c_iflag    \fP Input modes. \fB
tcflag_t  c_oflag    \fP Output modes. \fB
tcflag_t  c_cflag    \fP Control modes. \fB
tcflag_t  c_lflag    \fP Local modes. \fB
cc_t      c_cc[NCCS] \fP Control characters. \fB
\fP
.fi
.RE
.LP
A definition shall be provided for:
.TP 7
NCCS
Size of the array \fIc_cc\fP for control characters.
.sp
.LP
The following subscript names for the array \fIc_cc\fP shall be defined:
.TS C
center;c s l.
\fBSubscript Usage\fP	\ 
.T&
l l l.
\fBCanonical Mode\fP	\fBNon-Canonical Mode\fP	\fBDescription\fP
VEOF	\ 	EOF character.
VEOL	\ 	EOL character.
VERASE	\ 	ERASE character.
VINTR	VINTR	INTR character.
VKILL	\ 	KILL character.
\ 	VMIN	MIN value.
VQUIT	VQUIT	QUIT character.
VSTART	VSTART	START character.
VSTOP	VSTOP	STOP character.
VSUSP	VSUSP	SUSP character.
\ 	VTIME	TIME value.
.TE
.LP
The subscript values shall be unique, except that the VMIN and VTIME
subscripts may have the same values as the VEOF and VEOL
subscripts, respectively.
.LP
The following flags shall be provided.
.SS Input Modes
.LP
The \fIc_iflag\fP field describes the basic terminal input control:
.TP 7
BRKINT
Signal interrupt on break.
.TP 7
ICRNL
Map CR to NL on input.
.TP 7
IGNBRK
Ignore break condition.
.TP 7
IGNCR
Ignore CR.
.TP 7
IGNPAR
Ignore characters with parity errors.
.TP 7
INLCR
Map NL to CR on input.
.TP 7
INPCK
Enable input parity check.
.TP 7
ISTRIP
Strip character.
.TP 7
IXANY
Enable any character to restart output. 
.TP 7
IXOFF
Enable start/stop input control.
.TP 7
IXON
Enable start/stop output control.
.TP 7
PARMRK
Mark parity errors.
.sp
.SS Output Modes
.LP
The \fIc_oflag\fP field specifies the system treatment of output:
.TP 7
OPOST
Post-process output.
.TP 7
ONLCR
Map NL to CR-NL on output.
.TP 7
OCRNL
Map CR to NL on output.
.TP 7
ONOCR
No CR output at column 0.
.TP 7
ONLRET
NL performs CR function.
.TP 7
OFILL
Use fill characters for delay.
.TP 7
NLDLY
Select newline delays: 
.TP 7
NL0
.RS
Newline type 0.
.RE
.TP 7
NL1
.RS
Newline type 1.
.RE
.sp
.TP 7
CRDLY
Select carriage-return delays: 
.TP 7
CR0
.RS
Carriage-return delay type 0.
.RE
.TP 7
CR1
.RS
Carriage-return delay type 1.
.RE
.TP 7
CR2
.RS
Carriage-return delay type 2.
.RE
.TP 7
CR3
.RS
Carriage-return delay type 3.
.RE
.sp
.TP 7
TABDLY
Select horizontal-tab delays: 
.TP 7
TAB0
.RS
Horizontal-tab delay type 0.
.RE
.TP 7
TAB1
.RS
Horizontal-tab delay type 1.
.RE
.TP 7
TAB2
.RS
Horizontal-tab delay type 2.
.RE
.TP 7
TAB3
.RS
Expand tabs to spaces.
.RE
.sp
.TP 7
BSDLY
Select backspace delays: 
.TP 7
BS0
.RS
Backspace-delay type 0.
.RE
.TP 7
BS1
.RS
Backspace-delay type 1.
.RE
.sp
.TP 7
VTDLY
Select vertical-tab delays: 
.TP 7
VT0
.RS
Vertical-tab delay type 0.
.RE
.TP 7
VT1
.RS
Vertical-tab delay type 1.
.RE
.sp
.TP 7
FFDLY
Select form-feed delays: 
.TP 7
FF0
.RS
Form-feed delay type 0.
.RE
.TP 7
FF1
.RS
Form-feed delay type 1. 
.RE
.sp
.sp
.SS Baud Rate Selection
.LP
The input and output baud rates are stored in the \fBtermios\fP structure.
These are the valid values for objects of type
\fBspeed_t\fP. The following values shall be defined, but not all
baud rates need be supported by the underlying hardware.
.TP 7
B0
Hang up
.TP 7
B50
50 baud
.TP 7
B75
75 baud
.TP 7
B110
110 baud
.TP 7
B134
134.5 baud
.TP 7
B150
150 baud
.TP 7
B200
200 baud
.TP 7
B300
300 baud
.TP 7
B600
600 baud
.TP 7
B1200
1200 baud
.TP 7
B1800
1800 baud
.TP 7
B2400
2400 baud
.TP 7
B4800
4800 baud
.TP 7
B9600
9600 baud
.TP 7
B19200
19200 baud
.TP 7
B38400
38400 baud
.sp
.SS Control Modes
.LP
The \fIc_cflag\fP field describes the hardware control of the terminal;
not all values specified are required to be supported
by the underlying hardware:
.TP 7
CSIZE
Character size: 
.TP 7
CS5
.RS
5 bits
.RE
.TP 7
CS6
.RS
6 bits
.RE
.TP 7
CS7
.RS
7 bits
.RE
.TP 7
CS8
.RS
8 bits
.RE
.sp
.TP 7
CSTOPB
Send two stop bits, else one.
.TP 7
CREAD
Enable receiver.
.TP 7
PARENB
Parity enable.
.TP 7
PARODD
Odd parity, else even.
.TP 7
HUPCL
Hang up on last close.
.TP 7
CLOCAL
Ignore modem status lines.
.sp
.LP
The implementation shall support the functionality associated with
the symbols CS7, CS8, CSTOPB, PARODD, and PARENB.
.SS Local Modes
.LP
The \fIc_lflag\fP field of the argument structure is used to control
various terminal functions:
.TP 7
ECHO
Enable echo.
.TP 7
ECHOE
Echo erase character as error-correcting backspace.
.TP 7
ECHOK
Echo KILL.
.TP 7
ECHONL
Echo NL.
.TP 7
ICANON
Canonical input (erase and kill processing).
.TP 7
IEXTEN
Enable extended input character processing.
.TP 7
ISIG
Enable signals.
.TP 7
NOFLSH
Disable flush after interrupt or quit.
.TP 7
TOSTOP
Send SIGTTOU for background output.
.sp
.SS Attribute Selection
.LP
The following symbolic constants for use with \fItcsetattr\fP() are
defined:
.TP 7
TCSANOW
Change attributes immediately.
.TP 7
TCSADRAIN
Change attributes when output has drained.
.TP 7
TCSAFLUSH
Change attributes when output has drained; also flush pending input.
.sp
.SS Line Control
.LP
The following symbolic constants for use with \fItcflush\fP() shall
be defined:
.TP 7
TCIFLUSH
Flush pending input.
.TP 7
TCIOFLUSH
Flush both pending input and untransmitted output.
.TP 7
TCOFLUSH
Flush untransmitted output.
.sp
.LP
The following symbolic constants for use with \fItcflow\fP() shall
be defined:
.TP 7
TCIOFF
Transmit a STOP character, intended to suspend input data.
.TP 7
TCION
Transmit a START character, intended to restart input data.
.TP 7
TCOOFF
Suspend output.
.TP 7
TCOON
Restart output.
.sp
.LP
The following shall be declared as functions and may also be defined
as macros. Function prototypes shall be provided.
.sp
.RS
.nf

\fBspeed_t cfgetispeed(const struct termios *);
speed_t cfgetospeed(const struct termios *);
int     cfsetispeed(struct termios *, speed_t);
int     cfsetospeed(struct termios *, speed_t);
int     tcdrain(int);
int     tcflow(int, int);
int     tcflush(int, int);
int     tcgetattr(int, struct termios *);

pid_t   tcgetsid(int);

int     tcsendbreak(int, int);
int     tcsetattr(int, int, const struct termios *);
\fP
.fi
.RE
.LP
\fIThe following sections are informative.\fP
.SH APPLICATION USAGE
.LP
The following names are reserved for XSI-conformant systems to use
as an extension to the above; therefore strictly conforming
applications shall not use them:
.TS C
center; l l l.
CBAUD	EXTB	VDSUSP
DEFECHO	FLUSHO	VLNEXT
ECHOCTL	LOBLK	VREPRINT
ECHOKE	PENDIN	VSTATUS
ECHOPRT	SWTCH	VWERASE
EXTA	VDISCARD	\ 
.TE
.SH RATIONALE
.LP
None.
.SH FUTURE DIRECTIONS
.LP
None.
.SH SEE ALSO
.LP
The System Interfaces volume of IEEE\ Std\ 1003.1-2001, \fIcfgetispeed\fP(),
\fIcfgetospeed\fP(), \fIcfsetispeed\fP(), \fIcfsetospeed\fP(), \fIconfstr\fP(),
\fItcdrain\fP(), \fItcflow\fP(), \fItcflush\fP(), \fItcgetattr\fP(),
\fItcgetsid\fP(), \fItcsendbreak\fP(), \fItcsetattr\fP(), the Shell
and Utilities volume of IEEE\ Std\ 1003.1-2001, \fIgetconf\fP, \fIGeneral
Terminal Interface\fP
.SH COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
-- Portable Operating System Interface (POSIX), The Open Group Base
Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
Electrical and Electronics Engineers, Inc and The Open Group. In the
event of any discrepancy between this version and the original IEEE and
The Open Group Standard, the original IEEE and The Open Group Standard
is the referee document. The original Standard can be obtained online at
http://www.opengroup.org/unix/online.html .