]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (c) 1993 Michael Haardt |
2 | .\" (michael@moria.de) | |
3 | .\" Fri Apr 2 11:32:09 MET DST 1993 | |
4 | .\" | |
1dd72f9c | 5 | .\" %%%LICENSE_START(GPLv2+_DOC_FULL) |
fea681da MK |
6 | .\" This is free documentation; you can redistribute it and/or |
7 | .\" modify it under the terms of the GNU General Public License as | |
8 | .\" published by the Free Software Foundation; either version 2 of | |
9 | .\" the License, or (at your option) any later version. | |
10 | .\" | |
11 | .\" The GNU General Public License's references to "object code" | |
12 | .\" and "executables" are to be interpreted as the output of any | |
13 | .\" document formatting or typesetting system, including | |
14 | .\" intermediate and printed output. | |
15 | .\" | |
16 | .\" This manual is distributed in the hope that it will be useful, | |
17 | .\" but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 | .\" GNU General Public License for more details. | |
20 | .\" | |
21 | .\" You should have received a copy of the GNU General Public | |
c715f741 MK |
22 | .\" License along with this manual; if not, see |
23 | .\" <http://www.gnu.org/licenses/>. | |
6a8d8745 | 24 | .\" %%%LICENSE_END |
fea681da MK |
25 | .\" |
26 | .\" Modified 1993-07-24 by Rik Faith <faith@cs.unc.edu> | |
27 | .\" Modified 1995-02-25 by Jim Van Zandt <jrv@vanzandt.mv.com> | |
28 | .\" Modified 1995-09-02 by Jim Van Zandt <jrv@vanzandt.mv.com> | |
29 | .\" moved to man3, aeb, 950919 | |
c11b1abf | 30 | .\" Modified 2001-09-22 by Michael Kerrisk <mtk.manpages@gmail.com> |
fea681da MK |
31 | .\" Modified 2001-12-17, aeb |
32 | .\" Modified 2004-10-31, aeb | |
19ab0376 MK |
33 | .\" 2006-12-28, mtk: |
34 | .\" Added .SS headers to give some structure to this page; and a | |
35 | .\" small amount of reordering. | |
a6712802 | 36 | .\" Added a section on canonical and noncanonical mode. |
19ab0376 MK |
37 | .\" Enhanced the discussion of "raw" mode for cfmakeraw(). |
38 | .\" Document CMSPAR. | |
fea681da | 39 | .\" |
6f3c74a8 | 40 | .TH TERMIOS 3 2015-12-05 "Linux" "Linux Programmer's Manual" |
fea681da MK |
41 | .SH NAME |
42 | termios, tcgetattr, tcsetattr, tcsendbreak, tcdrain, tcflush, tcflow, | |
43 | cfmakeraw, cfgetospeed, cfgetispeed, cfsetispeed, cfsetospeed, cfsetspeed \- | |
44 | get and set terminal attributes, line control, get and set baud rate | |
45 | .SH SYNOPSIS | |
04bb6cc0 | 46 | .nf |
c91e381d | 47 | .B #include <termios.h> |
fea681da | 48 | .br |
c91e381d | 49 | .B #include <unistd.h> |
fea681da MK |
50 | .sp |
51 | .BI "int tcgetattr(int " fd ", struct termios *" termios_p ); | |
52 | .sp | |
04bb6cc0 MK |
53 | .BI "int tcsetattr(int " fd ", int " optional_actions , |
54 | .BI " const struct termios *" termios_p ); | |
fea681da MK |
55 | .sp |
56 | .BI "int tcsendbreak(int " fd ", int " duration ); | |
57 | .sp | |
58 | .BI "int tcdrain(int " fd ); | |
59 | .sp | |
60 | .BI "int tcflush(int " fd ", int " queue_selector ); | |
61 | .sp | |
62 | .BI "int tcflow(int " fd ", int " action ); | |
63 | .sp | |
64 | .BI "void cfmakeraw(struct termios *" termios_p ); | |
65 | .sp | |
66 | .BI "speed_t cfgetispeed(const struct termios *" termios_p ); | |
67 | .sp | |
68 | .BI "speed_t cfgetospeed(const struct termios *" termios_p ); | |
69 | .sp | |
70 | .BI "int cfsetispeed(struct termios *" termios_p ", speed_t " speed ); | |
71 | .sp | |
72 | .BI "int cfsetospeed(struct termios *" termios_p ", speed_t " speed ); | |
01d5d366 | 73 | .sp |
52dab97a | 74 | .BI "int cfsetspeed(struct termios *" termios_p ", speed_t " speed ); |
04bb6cc0 | 75 | .fi |
cc4615cc MK |
76 | .sp |
77 | .in -4n | |
78 | Feature Test Macro Requirements for glibc (see | |
79 | .BR feature_test_macros (7)): | |
80 | .in | |
81 | .sp | |
cc4615cc MK |
82 | .BR cfsetspeed (), |
83 | .BR cfmakeraw (): | |
84 | _BSD_SOURCE | |
fea681da MK |
85 | .SH DESCRIPTION |
86 | The termios functions describe a general terminal interface that is | |
87 | provided to control asynchronous communications ports. | |
73d8cece | 88 | .SS The termios structure |
fea681da MK |
89 | .LP |
90 | Many of the functions described here have a \fItermios_p\fP argument | |
c13182ef MK |
91 | that is a pointer to a \fItermios\fP structure. |
92 | This structure contains at least the following members: | |
fea681da | 93 | .sp |
a6e2f128 | 94 | .in +4n |
fea681da | 95 | .nf |
bd9b2a9c MK |
96 | tcflag_t c_iflag; /* input modes */ |
97 | tcflag_t c_oflag; /* output modes */ | |
98 | tcflag_t c_cflag; /* control modes */ | |
99 | tcflag_t c_lflag; /* local modes */ | |
d8b24e6e | 100 | cc_t c_cc[NCCS]; /* special characters */ |
fea681da | 101 | .fi |
a6e2f128 | 102 | .in |
fea681da | 103 | .PP |
869ebe5b | 104 | The values that may be assigned to these fields are described below. |
c13182ef MK |
105 | In the case of the first four bit-mask fields, |
106 | the definitions of some of the associated flags that may be set are | |
33a0ccb2 | 107 | exposed only if a specific feature test macro (see |
a8e7c990 | 108 | .BR feature_test_macros (7)) |
869ebe5b MK |
109 | is defined, as noted in brackets ("[]"). |
110 | .PP | |
42b09930 | 111 | In the descriptions below, "not in POSIX" means that the |
c13182ef MK |
112 | value is not specified in POSIX.1-2001, |
113 | and "XSI" means that the value is specified in POSIX.1-2001 | |
42b09930 MK |
114 | as part of the XSI extension. |
115 | .PP | |
fea681da MK |
116 | \fIc_iflag\fP flag constants: |
117 | .TP | |
118 | .B IGNBRK | |
119 | Ignore BREAK condition on input. | |
120 | .TP | |
121 | .B BRKINT | |
c13182ef MK |
122 | If \fBIGNBRK\fP is set, a BREAK is ignored. |
123 | If it is not set | |
fea681da MK |
124 | but \fBBRKINT\fP is set, then a BREAK causes the input and output |
125 | queues to be flushed, and if the terminal is the controlling | |
126 | terminal of a foreground process group, it will cause a | |
127 | \fBSIGINT\fP to be sent to this foreground process group. | |
128 | When neither \fBIGNBRK\fP nor \fBBRKINT\fP are set, a BREAK | |
f81fb444 | 129 | reads as a null byte (\(aq\\0\(aq), except when \fBPARMRK\fP is set, |
fea681da MK |
130 | in which case it reads as the sequence \\377 \\0 \\0. |
131 | .TP | |
132 | .B IGNPAR | |
133 | Ignore framing errors and parity errors. | |
134 | .TP | |
135 | .B PARMRK | |
2d7c8f1f | 136 | If this bit is set, input bytes with parity or framing errors are |
a0262e27 MK |
137 | marked when passed to the program. |
138 | This bit is meaningful only when | |
2d7c8f1f OT |
139 | \fBINPCK\fP is set and \fBIGNPAR\fP is not set. |
140 | The way erroneous bytes are marked is with two preceding bytes, | |
a0262e27 MK |
141 | \\377 and \\0. |
142 | Thus, the program actually reads three bytes for one | |
2d7c8f1f | 143 | erroneous byte received from the terminal. |
a0262e27 MK |
144 | If a valid byte has the value \\377, |
145 | and \fBISTRIP\fP (see below) is not set, | |
146 | the program might confuse it with the prefix that marks a | |
147 | parity error. | |
148 | Therefore, a valid byte \\377 is passed to the program as two | |
2d7c8f1f OT |
149 | bytes, \\377 \\377, in this case. |
150 | ||
c13182ef | 151 | If neither \fBIGNPAR\fP nor \fBPARMRK\fP |
fea681da MK |
152 | is set, read a character with a parity error or framing error |
153 | as \\0. | |
154 | .TP | |
155 | .B INPCK | |
156 | Enable input parity checking. | |
157 | .TP | |
158 | .B ISTRIP | |
159 | Strip off eighth bit. | |
160 | .TP | |
161 | .B INLCR | |
162 | Translate NL to CR on input. | |
163 | .TP | |
164 | .B IGNCR | |
165 | Ignore carriage return on input. | |
166 | .TP | |
167 | .B ICRNL | |
168 | Translate carriage return to newline on input (unless \fBIGNCR\fP is set). | |
169 | .TP | |
170 | .B IUCLC | |
171 | (not in POSIX) Map uppercase characters to lowercase on input. | |
172 | .TP | |
173 | .B IXON | |
174 | Enable XON/XOFF flow control on output. | |
175 | .TP | |
176 | .B IXANY | |
c13182ef | 177 | (XSI) Typing any character will restart stopped output. |
42b09930 | 178 | (The default is to allow just the START character to restart output.) |
fea681da MK |
179 | .TP |
180 | .B IXOFF | |
181 | Enable XON/XOFF flow control on input. | |
182 | .TP | |
183 | .B IMAXBEL | |
184 | (not in POSIX) Ring bell when input queue is full. | |
185 | Linux does not implement this bit, and acts as if it is always set. | |
225c76e9 MK |
186 | .TP |
187 | .BR IUTF8 " (since Linux 2.6.4)" | |
c13182ef | 188 | (not in POSIX) Input is UTF8; |
225c76e9 | 189 | this allows character-erase to be correctly performed in cooked mode. |
fea681da | 190 | .PP |
73da3537 MK |
191 | .I c_oflag |
192 | flag constants: | |
fea681da MK |
193 | .TP |
194 | .B OPOST | |
195 | Enable implementation-defined output processing. | |
fea681da MK |
196 | .TP |
197 | .B OLCUC | |
198 | (not in POSIX) Map lowercase characters to uppercase on output. | |
199 | .TP | |
200 | .B ONLCR | |
201 | (XSI) Map NL to CR-NL on output. | |
202 | .TP | |
203 | .B OCRNL | |
204 | Map CR to NL on output. | |
205 | .TP | |
206 | .B ONOCR | |
207 | Don't output CR at column 0. | |
208 | .TP | |
209 | .B ONLRET | |
210 | Don't output CR. | |
211 | .TP | |
212 | .B OFILL | |
213 | Send fill characters for a delay, rather than using a timed delay. | |
214 | .TP | |
215 | .B OFDEL | |
ffcffad6 | 216 | Fill character is ASCII DEL (0177). |
f81fb444 | 217 | If unset, fill character is ASCII NUL (\(aq\\0\(aq). |
42b09930 | 218 | (Not implemented on Linux.) |
fea681da MK |
219 | .TP |
220 | .B NLDLY | |
c13182ef MK |
221 | Newline delay mask. |
222 | Values are \fBNL0\fP and \fBNL1\fP. | |
db4e96b7 MK |
223 | [requires |
224 | .B _BSD_SOURCE | |
225 | or | |
226 | .B _SVID_SOURCE | |
c90511a6 MK |
227 | or |
228 | .BR _XOPEN_SOURCE ] | |
fea681da MK |
229 | .TP |
230 | .B CRDLY | |
231 | Carriage return delay mask. | |
232 | Values are \fBCR0\fP, \fBCR1\fP, \fBCR2\fP, or \fBCR3\fP. | |
db4e96b7 MK |
233 | [requires |
234 | .B _BSD_SOURCE | |
235 | or | |
236 | .B _SVID_SOURCE | |
c90511a6 MK |
237 | or |
238 | .BR _XOPEN_SOURCE ] | |
fea681da MK |
239 | .TP |
240 | .B TABDLY | |
241 | Horizontal tab delay mask. | |
242 | Values are \fBTAB0\fP, \fBTAB1\fP, \fBTAB2\fP, \fBTAB3\fP (or \fBXTABS\fP). | |
243 | A value of TAB3, that is, XTABS, expands tabs to spaces | |
244 | (with tab stops every eight columns). | |
db4e96b7 MK |
245 | [requires |
246 | .B _BSD_SOURCE | |
247 | or | |
248 | .B _SVID_SOURCE | |
c90511a6 MK |
249 | or |
250 | .BR _XOPEN_SOURCE ] | |
fea681da MK |
251 | .TP |
252 | .B BSDLY | |
c13182ef MK |
253 | Backspace delay mask. |
254 | Values are \fBBS0\fP or \fBBS1\fP. | |
fea681da | 255 | (Has never been implemented.) |
db4e96b7 MK |
256 | [requires |
257 | .B _BSD_SOURCE | |
258 | or | |
259 | .B _SVID_SOURCE | |
c90511a6 MK |
260 | or |
261 | .BR _XOPEN_SOURCE ] | |
fea681da MK |
262 | .TP |
263 | .B VTDLY | |
c13182ef MK |
264 | Vertical tab delay mask. |
265 | Values are \fBVT0\fP or \fBVT1\fP. | |
fea681da MK |
266 | .TP |
267 | .B FFDLY | |
c13182ef MK |
268 | Form feed delay mask. |
269 | Values are \fBFF0\fP or \fBFF1\fP. | |
db4e96b7 MK |
270 | [requires |
271 | .B _BSD_SOURCE | |
272 | or | |
273 | .B _SVID_SOURCE | |
c90511a6 MK |
274 | or |
275 | .BR _XOPEN_SOURCE ] | |
fea681da MK |
276 | .PP |
277 | \fIc_cflag\fP flag constants: | |
278 | .TP | |
279 | .B CBAUD | |
280 | (not in POSIX) Baud speed mask (4+1 bits). | |
db4e96b7 MK |
281 | [requires |
282 | .B _BSD_SOURCE | |
c90511a6 MK |
283 | or |
284 | .BR _SVID_SOURCE ] | |
fea681da MK |
285 | .TP |
286 | .B CBAUDEX | |
097585ed MK |
287 | (not in POSIX) Extra baud speed mask (1 bit), included in |
288 | .BR CBAUD . | |
db4e96b7 MK |
289 | [requires |
290 | .B _BSD_SOURCE | |
c90511a6 MK |
291 | or |
292 | .BR _SVID_SOURCE ] | |
42b09930 | 293 | .sp |
c13182ef MK |
294 | (POSIX says that the baud speed is stored in the |
295 | .I termios | |
42b09930 | 296 | structure without specifying where precisely, and provides |
63aa9df0 | 297 | .BR cfgetispeed () |
fea681da | 298 | and |
63aa9df0 | 299 | .BR cfsetispeed () |
c13182ef | 300 | for getting at it. |
097585ed MK |
301 | Some systems use bits selected by |
302 | .B CBAUD | |
303 | in | |
fea681da | 304 | .IR c_cflag , |
75b94dc3 | 305 | other systems use separate fields, for example, |
fea681da MK |
306 | .I sg_ispeed |
307 | and | |
308 | .IR sg_ospeed .) | |
309 | .TP | |
310 | .B CSIZE | |
311 | Character size mask. | |
312 | Values are \fBCS5\fP, \fBCS6\fP, \fBCS7\fP, or \fBCS8\fP. | |
313 | .TP | |
314 | .B CSTOPB | |
315 | Set two stop bits, rather than one. | |
316 | .TP | |
317 | .B CREAD | |
318 | Enable receiver. | |
319 | .TP | |
320 | .B PARENB | |
321 | Enable parity generation on output and parity checking for input. | |
322 | .TP | |
323 | .B PARODD | |
c13182ef | 324 | If set, then parity for input and output is odd; |
19ab0376 | 325 | otherwise even parity is used. |
fea681da MK |
326 | .TP |
327 | .B HUPCL | |
328 | Lower modem control lines after last process closes the device (hang up). | |
329 | .TP | |
330 | .B CLOCAL | |
331 | Ignore modem control lines. | |
332 | .TP | |
333 | .B LOBLK | |
24b74457 | 334 | (not in POSIX) Block output from a noncurrent shell layer. |
42b09930 | 335 | For use by \fBshl\fP (shell layers). (Not implemented on Linux.) |
fea681da MK |
336 | .TP |
337 | .B CIBAUD | |
4a837837 | 338 | (not in POSIX) Mask for input speeds. |
097585ed MK |
339 | The values for the |
340 | .B CIBAUD | |
341 | bits are | |
342 | the same as the values for the | |
343 | .B CBAUD | |
344 | bits, shifted left | |
345 | .B IBSHIFT | |
346 | bits. | |
db4e96b7 MK |
347 | [requires |
348 | .B _BSD_SOURCE | |
c90511a6 MK |
349 | or |
350 | .BR _SVID_SOURCE ] | |
42b09930 | 351 | (Not implemented on Linux.) |
fea681da | 352 | .TP |
adab6032 | 353 | .B CMSPAR |
ad715af9 | 354 | (not in POSIX) |
c13182ef | 355 | Use "stick" (mark/space) parity (supported on certain serial |
4a837837 | 356 | devices): if |
c13182ef | 357 | .B PARODD |
adab6032 | 358 | is set, the parity bit is always 1; if |
c13182ef | 359 | .B PARODD |
69ef1f65 | 360 | is not set, then the parity bit is always 0. |
db4e96b7 MK |
361 | [requires |
362 | .B _BSD_SOURCE | |
c90511a6 MK |
363 | or |
364 | .BR _SVID_SOURCE ] | |
adab6032 | 365 | .TP |
fea681da MK |
366 | .B CRTSCTS |
367 | (not in POSIX) Enable RTS/CTS (hardware) flow control. | |
db4e96b7 MK |
368 | [requires |
369 | .B _BSD_SOURCE | |
c90511a6 MK |
370 | or |
371 | .BR _SVID_SOURCE ] | |
fea681da MK |
372 | .PP |
373 | \fIc_lflag\fP flag constants: | |
374 | .TP | |
375 | .B ISIG | |
376 | When any of the characters INTR, QUIT, SUSP, or DSUSP are received, | |
377 | generate the corresponding signal. | |
378 | .TP | |
379 | .B ICANON | |
c13182ef | 380 | Enable canonical mode (described below). |
fea681da MK |
381 | .TP |
382 | .B XCASE | |
383 | (not in POSIX; not supported under Linux) | |
384 | If \fBICANON\fP is also set, terminal is uppercase only. | |
385 | Input is converted to lowercase, except for characters preceded by \\. | |
386 | On output, uppercase characters are preceded by \\ and lowercase | |
387 | characters are converted to uppercase. | |
6d1f5ca5 YK |
388 | [requires |
389 | .B _BSD_SOURCE | |
390 | or | |
391 | .B _SVID_SOURCE | |
392 | or | |
393 | .BR _XOPEN_SOURCE ] | |
c3dfd2c8 | 394 | .\" glibc is probably now wrong to allow |
eee28e75 MK |
395 | .\" Define |
396 | .\" .B _XOPEN_SOURCE | |
397 | .\" to expose | |
398 | .\" .BR XCASE . | |
fea681da MK |
399 | .TP |
400 | .B ECHO | |
401 | Echo input characters. | |
402 | .TP | |
403 | .B ECHOE | |
404 | If \fBICANON\fP is also set, the ERASE character erases the preceding | |
405 | input character, and WERASE erases the preceding word. | |
406 | .TP | |
407 | .B ECHOK | |
408 | If \fBICANON\fP is also set, the KILL character erases the current line. | |
409 | .TP | |
410 | .B ECHONL | |
411 | If \fBICANON\fP is also set, echo the NL character even if ECHO is not set. | |
412 | .TP | |
413 | .B ECHOCTL | |
d8b24e6e MK |
414 | (not in POSIX) If \fBECHO\fP is also set, |
415 | terminal special characters other than | |
8bb93cd4 MK |
416 | TAB, NL, START, and STOP are echoed as \fB^X\fP, |
417 | where X is the character with | |
d8b24e6e | 418 | ASCII code 0x40 greater than the special character. |
c13182ef | 419 | For example, character |
8bb93cd4 | 420 | 0x08 (BS) is echoed as \fB^H\fP. |
db4e96b7 MK |
421 | [requires |
422 | .B _BSD_SOURCE | |
c90511a6 MK |
423 | or |
424 | .BR _SVID_SOURCE ] | |
fea681da MK |
425 | .TP |
426 | .B ECHOPRT | |
96da8065 | 427 | (not in POSIX) If \fBICANON\fP and \fBECHO\fP are also set, characters |
fea681da | 428 | are printed as they are being erased. |
db4e96b7 MK |
429 | [requires |
430 | .B _BSD_SOURCE | |
c90511a6 MK |
431 | or |
432 | .BR _SVID_SOURCE ] | |
fea681da MK |
433 | .TP |
434 | .B ECHOKE | |
435 | (not in POSIX) If \fBICANON\fP is also set, KILL is echoed by erasing | |
436 | each character on the line, as specified by \fBECHOE\fP and \fBECHOPRT\fP. | |
db4e96b7 MK |
437 | [requires |
438 | .B _BSD_SOURCE | |
c90511a6 MK |
439 | or |
440 | .BR _SVID_SOURCE ] | |
fea681da MK |
441 | .TP |
442 | .B DEFECHO | |
443 | (not in POSIX) Echo only when a process is reading. | |
42b09930 | 444 | (Not implemented on Linux.) |
fea681da MK |
445 | .TP |
446 | .B FLUSHO | |
447 | (not in POSIX; not supported under Linux) | |
c13182ef MK |
448 | Output is being flushed. |
449 | This flag is toggled by typing | |
fea681da | 450 | the DISCARD character. |
db4e96b7 MK |
451 | [requires |
452 | .B _BSD_SOURCE | |
c90511a6 MK |
453 | or |
454 | .BR _SVID_SOURCE ] | |
fea681da MK |
455 | .TP |
456 | .B NOFLSH | |
6e502d47 MK |
457 | Disable flushing the input and output queues when generating signals for the |
458 | INT, QUIT, and SUSP characters. | |
459 | .\" Stevens lets SUSP only flush the input queue | |
fea681da MK |
460 | .TP |
461 | .B TOSTOP | |
8bd58774 MK |
462 | Send the |
463 | .B SIGTTOU | |
464 | signal to the process group of a background process | |
fea681da MK |
465 | which tries to write to its controlling terminal. |
466 | .TP | |
467 | .B PENDIN | |
468 | (not in POSIX; not supported under Linux) | |
469 | All characters in the input queue are reprinted when | |
c13182ef | 470 | the next character is read. |
5852aba2 MK |
471 | .RB ( bash (1) |
472 | handles typeahead this way.) | |
db4e96b7 MK |
473 | [requires |
474 | .B _BSD_SOURCE | |
c90511a6 MK |
475 | or |
476 | .BR _SVID_SOURCE ] | |
fea681da MK |
477 | .TP |
478 | .B IEXTEN | |
479 | Enable implementation-defined input processing. | |
0425de01 | 480 | This flag, as well as \fBICANON\fP must be enabled for the |
fea681da MK |
481 | special characters EOL2, LNEXT, REPRINT, WERASE to be interpreted, |
482 | and for the \fBIUCLC\fP flag to be effective. | |
483 | .PP | |
d8b24e6e | 484 | The \fIc_cc\fP array defines the terminal special characters. |
fea681da MK |
485 | The symbolic indices (initial values) and meaning are: |
486 | .TP | |
91e2779f MK |
487 | .B VDISCARD |
488 | (not in POSIX; not supported under Linux; 017, SI, Ctrl-O) | |
489 | Toggle: start/stop discarding pending output. | |
097585ed | 490 | Recognized when |
91e2779f | 491 | .B IEXTEN |
097585ed | 492 | is set, and then not passed as input. |
fea681da | 493 | .TP |
91e2779f MK |
494 | .B VDSUSP |
495 | (not in POSIX; not supported under Linux; 031, EM, Ctrl-Y) | |
489e425d | 496 | Delayed suspend character (DSUSP): |
91e2779f MK |
497 | send |
498 | .B SIGTSTP | |
499 | signal when the character is read by the user program. | |
097585ed | 500 | Recognized when |
91e2779f MK |
501 | .B IEXTEN |
502 | and | |
097585ed | 503 | .B ISIG |
91e2779f MK |
504 | are set, and the system supports |
505 | job control, and then not passed as input. | |
fea681da MK |
506 | .TP |
507 | .B VEOF | |
508 | (004, EOT, Ctrl-D) | |
489e425d | 509 | End-of-file character (EOF). |
fea681da MK |
510 | More precisely: this character causes the pending tty buffer to be sent |
511 | to the waiting user program without waiting for end-of-line. | |
d9c1ae64 MK |
512 | If it is the first character of the line, the |
513 | .BR read (2) | |
514 | in the user program returns 0, which signifies end-of-file. | |
097585ed MK |
515 | Recognized when |
516 | .B ICANON | |
517 | is set, and then not passed as input. | |
fea681da | 518 | .TP |
fea681da MK |
519 | .B VEOL |
520 | (0, NUL) | |
489e425d | 521 | Additional end-of-line character (EOL). |
097585ed MK |
522 | Recognized when |
523 | .B ICANON | |
524 | is set. | |
fea681da | 525 | .TP |
fea681da MK |
526 | .B VEOL2 |
527 | (not in POSIX; 0, NUL) | |
489e425d | 528 | Yet another end-of-line character (EOL2). |
097585ed MK |
529 | Recognized when |
530 | .B ICANON | |
531 | is set. | |
fea681da | 532 | .TP |
91e2779f MK |
533 | .B VERASE |
534 | (0177, DEL, rubout, or 010, BS, Ctrl-H, or also #) | |
489e425d | 535 | Erase character (ERASE). |
91e2779f MK |
536 | This erases the previous not-yet-erased character, |
537 | but does not erase past EOF or beginning-of-line. | |
097585ed | 538 | Recognized when |
91e2779f | 539 | .B ICANON |
097585ed | 540 | is set, and then not passed as input. |
fea681da | 541 | .TP |
91e2779f MK |
542 | .B VINTR |
543 | (003, ETX, Ctrl-C, or also 0177, DEL, rubout) | |
489e425d | 544 | Interrupt character (INTR). |
91e2779f MK |
545 | Send a |
546 | .B SIGINT | |
8bd58774 | 547 | signal. |
097585ed MK |
548 | Recognized when |
549 | .B ISIG | |
550 | is set, and then not passed as input. | |
fea681da | 551 | .TP |
91e2779f MK |
552 | .B VKILL |
553 | (025, NAK, Ctrl-U, or Ctrl-X, or also @) | |
489e425d | 554 | Kill character (KILL). |
91e2779f | 555 | This erases the input since the last EOF or beginning-of-line. |
097585ed | 556 | Recognized when |
91e2779f MK |
557 | .B ICANON |
558 | is set, and then not passed as input. | |
fea681da MK |
559 | .TP |
560 | .B VLNEXT | |
561 | (not in POSIX; 026, SYN, Ctrl-V) | |
489e425d | 562 | Literal next (LNEXT). |
c13182ef | 563 | Quotes the next input character, depriving it of |
fea681da | 564 | a possible special meaning. |
097585ed MK |
565 | Recognized when |
566 | .B IEXTEN | |
567 | is set, and then not passed as input. | |
fea681da | 568 | .TP |
91e2779f | 569 | .B VMIN |
489e425d | 570 | Minimum number of characters for noncanonical read (MIN). |
91e2779f MK |
571 | .TP |
572 | .B VQUIT | |
31a6818e | 573 | (034, FS, Ctrl-\e) |
489e425d | 574 | Quit character (QUIT). |
91e2779f MK |
575 | Send |
576 | .B SIGQUIT | |
577 | signal. | |
097585ed | 578 | Recognized when |
91e2779f MK |
579 | .B ISIG |
580 | is set, and then not passed as input. | |
fea681da MK |
581 | .TP |
582 | .B VREPRINT | |
583 | (not in POSIX; 022, DC2, Ctrl-R) | |
489e425d | 584 | Reprint unread characters (REPRINT). |
097585ed MK |
585 | Recognized when |
586 | .B ICANON | |
587 | and | |
588 | .B IEXTEN | |
589 | are set, and then not passed as input. | |
fea681da | 590 | .TP |
91e2779f MK |
591 | .B VSTART |
592 | (021, DC1, Ctrl-Q) | |
489e425d | 593 | Start character (START). |
91e2779f | 594 | Restarts output stopped by the Stop character. |
097585ed | 595 | Recognized when |
91e2779f | 596 | .B IXON |
097585ed | 597 | is set, and then not passed as input. |
fea681da MK |
598 | .TP |
599 | .B VSTATUS | |
600 | (not in POSIX; not supported under Linux; | |
601 | status request: 024, DC4, Ctrl-T). | |
a6639d09 MK |
602 | Status character (STATUS). |
603 | Display status information at terminal, | |
604 | including state of foreground process and amount of CPU time it has consumed. | |
605 | Also sends a | |
606 | .BR SIGINFO | |
607 | signal (not supported on Linux) to the foreground process group. | |
91e2779f MK |
608 | .TP |
609 | .B VSTOP | |
610 | (023, DC3, Ctrl-S) | |
489e425d | 611 | Stop character (STOP). |
91e2779f MK |
612 | Stop output until Start character typed. |
613 | Recognized when | |
614 | .B IXON | |
615 | is set, and then not passed as input. | |
616 | .TP | |
617 | .B VSUSP | |
618 | (032, SUB, Ctrl-Z) | |
489e425d | 619 | Suspend character (SUSP). |
91e2779f MK |
620 | Send |
621 | .B SIGTSTP | |
622 | signal. | |
623 | Recognized when | |
624 | .B ISIG | |
625 | is set, and then not passed as input. | |
626 | .TP | |
627 | .B VSWTCH | |
628 | (not in POSIX; not supported under Linux; 0, NUL) | |
489e425d | 629 | Switch character (SWTCH). |
33b7fff5 MK |
630 | Used in System V to switch shells in |
631 | .IR "shell layers" , | |
5aaf78b7 | 632 | a predecessor to shell job control. |
91e2779f MK |
633 | .TP |
634 | .B VTIME | |
489e425d | 635 | Timeout in deciseconds for noncanonical read (TIME). |
91e2779f MK |
636 | .TP |
637 | .B VWERASE | |
638 | (not in POSIX; 027, ETB, Ctrl-W) | |
489e425d | 639 | Word erase (WERASE). |
91e2779f MK |
640 | Recognized when |
641 | .B ICANON | |
642 | and | |
643 | .B IEXTEN | |
644 | are set, and then not passed as input. | |
fea681da | 645 | .LP |
d51529b8 MK |
646 | An individual terminal special character can be disabled by setting |
647 | the value of the corresponding | |
648 | .I c_cc | |
649 | element to | |
650 | .BR _POSIX_VDISABLE . | |
651 | .LP | |
652 | The above symbolic subscript values are all different, except that | |
097585ed | 653 | .BR VTIME , |
0daa9e92 | 654 | .B VMIN |
097585ed | 655 | may have the same value as |
3cf81850 | 656 | .BR VEOL , |
097585ed MK |
657 | .BR VEOF , |
658 | respectively. | |
a6712802 | 659 | In noncanonical mode the special character meaning is replaced |
c13182ef | 660 | by the timeout meaning. |
097585ed MK |
661 | For an explanation of |
662 | .B VMIN | |
663 | and | |
664 | .BR VTIME , | |
665 | see the description of | |
a6712802 | 666 | noncanonical mode below. |
73d8cece | 667 | .SS Retrieving and changing terminal settings |
fea681da | 668 | .PP |
63aa9df0 | 669 | .BR tcgetattr () |
fea681da | 670 | gets the parameters associated with the object referred by \fIfd\fP and |
869ebe5b | 671 | stores them in the \fItermios\fP structure referenced by |
c13182ef MK |
672 | \fItermios_p\fP. |
673 | This function may be invoked from a background process; | |
fea681da MK |
674 | however, the terminal attributes may be subsequently changed by a |
675 | foreground process. | |
676 | .LP | |
63aa9df0 | 677 | .BR tcsetattr () |
fea681da MK |
678 | sets the parameters associated with the terminal (unless support is |
679 | required from the underlying hardware that is not available) from the | |
c13182ef | 680 | \fItermios\fP structure referred to by \fItermios_p\fP. |
fea681da MK |
681 | \fIoptional_actions\fP specifies when the changes take effect: |
682 | .IP \fBTCSANOW\fP | |
683 | the change occurs immediately. | |
684 | .IP \fBTCSADRAIN\fP | |
685 | the change occurs after all output written to | |
686 | .I fd | |
c13182ef | 687 | has been transmitted. |
d1c2e0f2 | 688 | This option should be used when changing |
fea681da MK |
689 | parameters that affect output. |
690 | .IP \fBTCSAFLUSH\fP | |
691 | the change occurs after all output written to the object referred by | |
692 | .I fd | |
693 | has been transmitted, and all input that has been received but not read | |
694 | will be discarded before the change is made. | |
73d8cece | 695 | .SS Canonical and noncanonical mode |
19ab0376 MK |
696 | The setting of the |
697 | .B ICANON | |
698 | canon flag in | |
699 | .I c_lflag | |
700 | determines whether the terminal is operating in canonical mode | |
701 | .RB ( ICANON | |
702 | set) or | |
a6712802 | 703 | noncanonical mode |
c13182ef | 704 | .RB ( ICANON |
19ab0376 MK |
705 | unset). |
706 | By default, | |
707 | .B ICANON | |
708 | set. | |
709 | ||
710 | In canonical mode: | |
711 | .IP * 2 | |
712 | Input is made available line by line. | |
713 | An input line is available when one of the line delimiters | |
714 | is typed (NL, EOL, EOL2; or EOF at the start of line). | |
715 | Except in the case of EOF, the line delimiter is included | |
716 | in the buffer returned by | |
717 | .BR read (2). | |
718 | .IP * 2 | |
c13182ef MK |
719 | Line editing is enabled (ERASE, KILL; |
720 | and if the | |
19ab0376 MK |
721 | .B IEXTEN |
722 | flag is set: WERASE, REPRINT, LNEXT). | |
c13182ef | 723 | A |
fb186734 | 724 | .BR read (2) |
19ab0376 | 725 | returns at most one line of input; if the |
fb186734 | 726 | .BR read (2) |
19ab0376 MK |
727 | requested fewer bytes than are available in the current line of input, |
728 | then only as many bytes as requested are read, | |
729 | and the remaining characters will be available for a future | |
fb186734 | 730 | .BR read (2). |
19ab0376 | 731 | .PP |
a6712802 | 732 | In noncanonical mode input is available immediately (without |
19ab0376 | 733 | the user having to type a line-delimiter character), |
764d3de3 | 734 | no input processing is performed, |
19ab0376 | 735 | and line editing is disabled. |
c13182ef | 736 | The settings of MIN |
19ab0376 | 737 | .RI ( c_cc[VMIN] ) |
0f8b10eb | 738 | and TIME |
19ab0376 MK |
739 | .RI ( c_cc[VTIME] ) |
740 | determine the circumstances in which a | |
741 | .BR read (2) | |
742 | completes; there are four distinct cases: | |
959c4b25 | 743 | .TP |
f8f8b9c1 | 744 | MIN == 0, TIME == 0 (polling read) |
19ab0376 | 745 | If data is available, |
fb186734 | 746 | .BR read (2) |
19ab0376 MK |
747 | returns immediately, with the lesser of the number of bytes |
748 | available, or the number of bytes requested. | |
749 | If no data is available, | |
fb186734 | 750 | .BR read (2) |
19ab0376 | 751 | returns 0. |
959c4b25 | 752 | .TP |
f8f8b9c1 | 753 | MIN > 0, TIME == 0 (blocking read) |
fb186734 | 754 | .BR read (2) |
4b985dd6 MK |
755 | blocks until MIN bytes are available, |
756 | and returns up to the number of bytes requested. | |
959c4b25 | 757 | .TP |
f8f8b9c1 | 758 | MIN == 0, TIME > 0 (read with timeout) |
19ab0376 | 759 | TIME specifies the limit for a timer in tenths of a second. |
c13182ef | 760 | The timer is started when |
fb186734 | 761 | .BR read (2) |
19ab0376 | 762 | is called. |
fb186734 | 763 | .BR read (2) |
19ab0376 MK |
764 | returns either when at least one byte of data is available, |
765 | or when the timer expires. | |
766 | If the timer expires without any input becoming available, | |
fb186734 | 767 | .BR read (2) |
19ab0376 | 768 | returns 0. |
e764d1b7 | 769 | If data is already available at the time of the call to |
8563c249 | 770 | .BR read (2), |
e764d1b7 | 771 | the call behaves as though the data was received immediately after the call. |
959c4b25 | 772 | .TP |
f8f8b9c1 | 773 | MIN > 0, TIME > 0 (read with interbyte timeout) |
19ab0376 MK |
774 | TIME specifies the limit for a timer in tenths of a second. |
775 | Once an initial byte of input becomes available, | |
776 | the timer is restarted after each further byte is received. | |
fb186734 | 777 | .BR read (2) |
a9f0126f MK |
778 | returns when any of the following conditions is met: |
779 | .RS | |
780 | .IP * 3 | |
781 | MIN bytes have been received. | |
782 | .IP * | |
783 | The interbyte timer expires. | |
784 | .IP * | |
785 | The number of bytes requested by | |
786 | .BR read (2) | |
787 | has been received. | |
788 | (POSIX does not specify this termination condition, | |
789 | and on some other implementations | |
790 | .\" e.g., Solaris | |
8563c249 | 791 | .BR read (2) |
a9f0126f MK |
792 | does not return in this case.) |
793 | .RE | |
794 | .IP | |
33a0ccb2 | 795 | Because the timer is started only after the initial byte |
19ab0376 | 796 | becomes available, at least one byte will be read. |
e764d1b7 | 797 | If data is already available at the time of the call to |
8563c249 | 798 | .BR read (2), |
e764d1b7 | 799 | the call behaves as though the data was received immediately after the call. |
5ee2d3c5 MK |
800 | .PP |
801 | POSIX | |
802 | .\" POSIX.1-2008 XBD 11.1.7 | |
803 | does not specify whether the setting of the | |
804 | .B O_NONBLOCK | |
805 | file status flag takes precedence over the MIN and TIME settings. | |
806 | If | |
807 | .B O_NONBLOCK | |
808 | is set, a | |
8563c249 | 809 | .BR read (2) |
5ee2d3c5 MK |
810 | in noncanonical mode may return immediately, |
811 | regardless of the setting of MIN or TIME. | |
812 | Furthermore, if no data is available, | |
813 | POSIX permits a | |
8563c249 | 814 | .BR read (2) |
5ee2d3c5 MK |
815 | in noncanonical mode to return either 0, or \-1 with |
816 | .I errno | |
817 | set to | |
818 | .BR EAGAIN . | |
73d8cece | 819 | .SS Raw mode |
19ab0376 | 820 | .LP |
60a90ecd MK |
821 | .BR cfmakeraw () |
822 | sets the terminal to something like the | |
1954b6a9 | 823 | "raw" mode of the old Version 7 terminal driver: |
19ab0376 | 824 | input is available character by character, |
c13182ef | 825 | echoing is disabled, and all special processing of |
19ab0376 MK |
826 | terminal input and output characters is disabled. |
827 | The terminal attributes are set as follows: | |
828 | .nf | |
829 | ||
94e9d9fe | 830 | termios_p\->c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP |
19ab0376 | 831 | | INLCR | IGNCR | ICRNL | IXON); |
94e9d9fe MK |
832 | termios_p\->c_oflag &= ~OPOST; |
833 | termios_p\->c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN); | |
834 | termios_p\->c_cflag &= ~(CSIZE | PARENB); | |
835 | termios_p\->c_cflag |= CS8; | |
19ab0376 | 836 | .fi |
73d8cece | 837 | .SS Line control |
fea681da | 838 | .LP |
63aa9df0 | 839 | .BR tcsendbreak () |
fea681da MK |
840 | transmits a continuous stream of zero-valued bits for a specific |
841 | duration, if the terminal is using asynchronous serial data | |
c13182ef MK |
842 | transmission. |
843 | If \fIduration\fP is zero, it transmits zero-valued bits | |
844 | for at least 0.25 seconds, and not more that 0.5 seconds. | |
845 | If \fIduration\fP is not zero, it sends zero-valued bits for some | |
fea681da MK |
846 | implementation-defined length of time. |
847 | .LP | |
848 | If the terminal is not using asynchronous serial data transmission, | |
60a90ecd MK |
849 | .BR tcsendbreak () |
850 | returns without taking any action. | |
fea681da | 851 | .LP |
63aa9df0 | 852 | .BR tcdrain () |
fea681da MK |
853 | waits until all output written to the object referred to by |
854 | .I fd | |
855 | has been transmitted. | |
856 | .LP | |
63aa9df0 | 857 | .BR tcflush () |
fea681da MK |
858 | discards data written to the object referred to by |
859 | .I fd | |
860 | but not transmitted, or data received but not read, depending on the | |
861 | value of | |
862 | .IR queue_selector : | |
863 | .IP \fBTCIFLUSH\fP | |
864 | flushes data received but not read. | |
865 | .IP \fBTCOFLUSH\fP | |
866 | flushes data written but not transmitted. | |
867 | .IP \fBTCIOFLUSH\fP | |
868 | flushes both data received but not read, and data written but not | |
869 | transmitted. | |
870 | .LP | |
63aa9df0 | 871 | .BR tcflow () |
fea681da MK |
872 | suspends transmission or reception of data on the object referred to by |
873 | .IR fd , | |
874 | depending on the value of | |
875 | .IR action : | |
876 | .IP \fBTCOOFF\fP | |
877 | suspends output. | |
878 | .IP \fBTCOON\fP | |
879 | restarts suspended output. | |
880 | .IP \fBTCIOFF\fP | |
c13182ef | 881 | transmits a STOP character, which stops the terminal device from |
35478399 | 882 | transmitting data to the system. |
fea681da | 883 | .IP \fBTCION\fP |
c13182ef | 884 | transmits a START character, which starts the terminal device |
35478399 | 885 | transmitting data to the system. |
fea681da MK |
886 | .LP |
887 | The default on open of a terminal file is that neither its input nor its | |
888 | output is suspended. | |
73d8cece | 889 | .SS Line speed |
87d1fd87 | 890 | The baud rate functions are provided for getting and setting the values |
c13182ef MK |
891 | of the input and output baud rates in the \fItermios\fP structure. |
892 | The new values do not take effect | |
60a90ecd MK |
893 | until |
894 | .BR tcsetattr () | |
895 | is successfully called. | |
87d1fd87 MK |
896 | |
897 | Setting the speed to \fBB0\fP instructs the modem to "hang up". | |
898 | The actual bit rate corresponding to \fBB38400\fP may be altered with | |
60a90ecd | 899 | .BR setserial (8). |
87d1fd87 MK |
900 | .LP |
901 | The input and output baud rates are stored in the \fItermios\fP | |
902 | structure. | |
fea681da | 903 | .LP |
63aa9df0 | 904 | .BR cfgetospeed () |
869ebe5b | 905 | returns the output baud rate stored in the \fItermios\fP structure |
fea681da MK |
906 | pointed to by |
907 | .IR termios_p . | |
908 | .LP | |
63aa9df0 | 909 | .BR cfsetospeed () |
869ebe5b | 910 | sets the output baud rate stored in the \fItermios\fP structure pointed |
fea681da MK |
911 | to by \fItermios_p\fP to \fIspeed\fP, which must be one of these constants: |
912 | .nf | |
869ebe5b | 913 | |
fea681da MK |
914 | .ft B |
915 | B0 | |
916 | B50 | |
917 | B75 | |
918 | B110 | |
919 | B134 | |
920 | B150 | |
921 | B200 | |
922 | B300 | |
923 | B600 | |
924 | B1200 | |
925 | B1800 | |
926 | B2400 | |
927 | B4800 | |
928 | B9600 | |
929 | B19200 | |
930 | B38400 | |
931 | B57600 | |
932 | B115200 | |
933 | B230400 | |
934 | .ft P | |
869ebe5b | 935 | |
fea681da MK |
936 | .fi |
937 | The zero baud rate, \fBB0\fP, | |
c13182ef MK |
938 | is used to terminate the connection. |
939 | If B0 is specified, the modem control lines shall no longer be asserted. | |
be7fff26 MK |
940 | Normally, this will disconnect the line. |
941 | \fBCBAUDEX\fP is a mask | |
fea681da | 942 | for the speeds beyond those defined in POSIX.1 (57600 and above). |
c7094399 | 943 | Thus, \fBB57600\fP & \fBCBAUDEX\fP is nonzero. |
fea681da | 944 | .LP |
63aa9df0 | 945 | .BR cfgetispeed () |
869ebe5b | 946 | returns the input baud rate stored in the \fItermios\fP structure. |
fea681da | 947 | .LP |
63aa9df0 | 948 | .BR cfsetispeed () |
869ebe5b | 949 | sets the input baud rate stored in the \fItermios\fP structure to |
c13182ef | 950 | .IR speed , |
869ebe5b MK |
951 | which must be specified as one of the \fBBnnn\fP constants listed above for |
952 | .BR cfsetospeed (). | |
fea681da MK |
953 | If the input baud rate is set to zero, the input baud rate will be |
954 | equal to the output baud rate. | |
955 | .LP | |
63aa9df0 | 956 | .BR cfsetspeed () |
c13182ef MK |
957 | is a 4.4BSD extension. |
958 | It takes the same arguments as | |
869ebe5b MK |
959 | .BR cfsetispeed (), |
960 | and sets both input and output speed. | |
47297adb | 961 | .SH RETURN VALUE |
fea681da | 962 | .LP |
63aa9df0 | 963 | .BR cfgetispeed () |
fea681da | 964 | returns the input baud rate stored in the |
869ebe5b | 965 | \fItermios\fP |
fea681da MK |
966 | structure. |
967 | .LP | |
63aa9df0 | 968 | .BR cfgetospeed () |
869ebe5b | 969 | returns the output baud rate stored in the \fItermios\fP structure. |
fea681da MK |
970 | .LP |
971 | All other functions return: | |
972 | .IP 0 | |
973 | on success. | |
974 | .IP \-1 | |
975 | on failure and set | |
976 | .I errno | |
977 | to indicate the error. | |
978 | .LP | |
979 | Note that | |
f87925c6 | 980 | .BR tcsetattr () |
fea681da | 981 | returns success if \fIany\fP of the requested changes could be |
c13182ef MK |
982 | successfully carried out. |
983 | Therefore, when making multiple changes | |
fea681da | 984 | it may be necessary to follow this call with a further call to |
f87925c6 | 985 | .BR tcgetattr () |
fea681da | 986 | to check that all changes have been performed successfully. |
2be8b1b2 | 987 | .SH ATTRIBUTES |
146c2ef3 PH |
988 | For an explanation of the terms used in this section, see |
989 | .BR attributes (7). | |
990 | .nh | |
991 | .ad l | |
992 | .TS | |
993 | allbox; | |
b2a64861 | 994 | lbw36 lb lb |
84a15261 | 995 | l l l. |
146c2ef3 PH |
996 | Interface Attribute Value |
997 | T{ | |
2be8b1b2 PH |
998 | .BR tcgetattr (), |
999 | .BR tcsetattr (), | |
2be8b1b2 PH |
1000 | .BR tcdrain (), |
1001 | .BR tcflush (), | |
ff548faa | 1002 | .BR tcflow (), |
b2a64861 | 1003 | .BR tcsendbreak (), |
2be8b1b2 PH |
1004 | .BR cfmakeraw (), |
1005 | .BR cfgetispeed (), | |
1006 | .BR cfgetospeed (), | |
1007 | .BR cfsetispeed (), | |
1008 | .BR cfsetospeed (), | |
2be8b1b2 | 1009 | .BR cfsetspeed () |
b6c73e0b ZL |
1010 | .\" FIXME: the following markings are different from which in glibc manual, |
1011 | .\" markings in glibc manual are more detailed. | |
1012 | .\" tcsendbreak: MT-Unsafe race:tcattr(filedes)/bsd | |
1013 | .\" tcflow: MT-Unsafe race:tcattr(filedes)/bsd | |
1014 | .\" glibc manual says /bsd indicate the preceding marker only applies | |
6e8ccc0d | 1015 | .\" when the underlying kernel is a BSD kernel. |
b6c73e0b | 1016 | .\" So, it is safety in Linux kernel. |
146c2ef3 PH |
1017 | T} Thread safety MT-Safe |
1018 | .TE | |
1019 | .ad | |
1020 | .hy | |
dfb631a8 MK |
1021 | .SH CONFORMING TO |
1022 | .BR tcgetattr (), | |
1023 | .BR tcsetattr (), | |
1024 | .BR tcsendbreak (), | |
1025 | .BR tcdrain (), | |
1026 | .BR tcflush (), | |
1027 | .BR tcflow (), | |
1028 | .BR cfgetispeed (), | |
1029 | .BR cfgetospeed (), | |
1030 | .BR cfsetispeed (), | |
1031 | and | |
1032 | .BR cfsetospeed () | |
1033 | are specified in POSIX.1-2001. | |
1034 | ||
1035 | .BR cfmakeraw () | |
01d5d366 MK |
1036 | and |
1037 | .BR cfsetspeed () | |
c8f2dd47 | 1038 | are nonstandard, but available on the BSDs. |
fea681da | 1039 | .SH NOTES |
b4112efb | 1040 | UNIX\ V7 and several later systems have a list of baud rates |
fea681da MK |
1041 | where after the fourteen values B0, ..., B9600 one finds the |
1042 | two constants EXTA, EXTB ("External A" and "External B"). | |
1043 | Many systems extend the list with much higher baud rates. | |
1044 | .LP | |
c7094399 | 1045 | The effect of a nonzero \fIduration\fP with |
60a90ecd MK |
1046 | .BR tcsendbreak () |
1047 | varies. | |
c13182ef | 1048 | SunOS specifies a break of |
8b8d0001 | 1049 | .I "duration\ *\ N" |
fea681da MK |
1050 | seconds, where \fIN\fP is at least 0.25, and not more than 0.5. |
1051 | Linux, AIX, DU, Tru64 send a break of | |
1052 | .I duration | |
1053 | milliseconds. | |
1054 | FreeBSD and NetBSD and HP-UX and MacOS ignore the value of | |
1055 | .IR duration . | |
1f409d5d | 1056 | Under Solaris and UnixWare, |
e511ffb6 | 1057 | .BR tcsendbreak () |
c7094399 | 1058 | with nonzero |
fea681da MK |
1059 | .I duration |
1060 | behaves like | |
e511ffb6 | 1061 | .BR tcdrain (). |
fea681da MK |
1062 | .\" libc4 until 4.7.5, glibc for sysv: EINVAL for duration > 0. |
1063 | .\" libc4.7.6, libc5, glibc for unix: duration in ms. | |
1064 | .\" glibc for bsd: duration in us | |
1065 | .\" glibc for sunos4: ignore duration | |
47297adb | 1066 | .SH SEE ALSO |
c04700fb MK |
1067 | .BR reset (1), |
1068 | .BR setterm (1), | |
fea681da | 1069 | .BR stty (1), |
c04700fb | 1070 | .BR tput (1), |
ca8c33fc | 1071 | .BR tset (1), |
fe62e3de MK |
1072 | .BR console_ioctl (4), |
1073 | .BR tty_ioctl (4), | |
fea681da | 1074 | .BR setserial (8) |