logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

termios.h.0p (10089B)


  1. '\" et
  2. .TH termios.h "0P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. termios.h
  12. \(em define values for termios
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <termios.h>
  17. .fi
  18. .SH DESCRIPTION
  19. The
  20. .IR <termios.h>
  21. header shall contain the definitions used by the terminal I/O
  22. interfaces (see
  23. .IR "Chapter 11" ", " "General Terminal Interface"
  24. for the structures and names defined).
  25. .SS "The termios Structure"
  26. .P
  27. The
  28. .IR <termios.h>
  29. header shall define the following data types through
  30. .BR typedef :
  31. .IP "\fBcc_t\fP" 12
  32. Used for terminal special characters.
  33. .IP "\fBspeed_t\fP" 12
  34. Used for terminal baud rates.
  35. .IP "\fBtcflag_t\fP" 12
  36. Used for terminal modes.
  37. .P
  38. The above types shall be all unsigned integer types.
  39. .P
  40. The implementation shall support one or more programming environments
  41. in which the widths of
  42. .BR cc_t ,
  43. .BR speed_t ,
  44. and
  45. .BR tcflag_t
  46. are no greater than the width of type
  47. .BR long .
  48. The names of these programming environments can be obtained using the
  49. \fIconfstr\fR()
  50. function or the
  51. .IR getconf
  52. utility.
  53. .P
  54. The
  55. .IR <termios.h>
  56. header shall define the
  57. .BR termios
  58. structure, which shall include at least the following members:
  59. .sp
  60. .RS 4
  61. .nf
  62. tcflag_t c_iflag \fRInput modes.\fR
  63. tcflag_t c_oflag \fROutput modes.\fR
  64. tcflag_t c_cflag \fRControl modes.\fR
  65. tcflag_t c_lflag \fRLocal modes.\fR
  66. cc_t c_cc[NCCS] \fRControl characters.\fR
  67. .fi
  68. .P
  69. .RE
  70. .P
  71. The
  72. .IR <termios.h>
  73. header shall define the following symbolic constant:
  74. .IP NCCS 12
  75. Size of the array
  76. .IR c_cc
  77. for control characters.
  78. .P
  79. The
  80. .IR <termios.h>
  81. header shall define the following symbolic constants for use as
  82. subscripts for the array
  83. .IR c_cc :
  84. .TS
  85. box center tab(!);
  86. cb s | l
  87. cb cb | cb
  88. l | l | l.
  89. Subscript Usage
  90. Canonical Mode!Non-Canonical Mode!Description
  91. _
  92. VEOF!!EOF character.
  93. VEOL!!EOL character.
  94. VERASE!!ERASE character.
  95. VINTR!VINTR!INTR character.
  96. VKILL!!KILL character.
  97. \&!VMIN!MIN value.
  98. VQUIT!VQUIT!QUIT character.
  99. VSTART!VSTART!START character.
  100. VSTOP!VSTOP!STOP character.
  101. VSUSP!VSUSP!SUSP character.
  102. \&!VTIME!TIME value.
  103. .TE
  104. .P
  105. The subscript values shall be suitable for use in
  106. .BR #if
  107. preprocessing directives and shall be distinct, except that the VMIN
  108. and VTIME subscripts may have the same values as the VEOF and
  109. VEOL subscripts, respectively.
  110. .SS "Input Modes"
  111. .P
  112. The
  113. .IR <termios.h>
  114. header shall define the following symbolic constants for use as flags
  115. in the
  116. .IR c_iflag
  117. field. The
  118. .IR c_iflag
  119. field describes the basic terminal input control.
  120. .IP BRKINT 12
  121. Signal interrupt on break.
  122. .IP ICRNL 12
  123. Map CR to NL on input.
  124. .IP IGNBRK 12
  125. Ignore break condition.
  126. .IP IGNCR 12
  127. Ignore CR.
  128. .IP IGNPAR 12
  129. Ignore characters with parity errors.
  130. .IP INLCR 12
  131. Map NL to CR on input.
  132. .IP INPCK 12
  133. Enable input parity check.
  134. .IP ISTRIP 12
  135. Strip character.
  136. .IP IXANY 12
  137. Enable any character to restart output.
  138. .IP IXOFF 12
  139. Enable start/stop input control.
  140. .IP IXON 12
  141. Enable start/stop output control.
  142. .IP PARMRK 12
  143. Mark parity errors.
  144. .SS "Output Modes"
  145. .P
  146. The
  147. .IR <termios.h>
  148. header shall define the following symbolic constants for use as flags
  149. in the
  150. .IR c_oflag
  151. field. The
  152. .IR c_oflag
  153. field specifies the system treatment of output.
  154. .IP OPOST 12
  155. Post-process output.
  156. .IP ONLCR 12
  157. Map NL to CR-NL on output.
  158. .IP OCRNL 12
  159. Map CR to NL on output.
  160. .IP ONOCR 12
  161. No CR output at column 0.
  162. .IP ONLRET 12
  163. NL performs CR function.
  164. .IP OFDEL 12
  165. Fill is DEL.
  166. .IP OFILL 12
  167. Use fill characters for delay.
  168. .IP NLDLY 12
  169. Select newline delays:
  170. .RS 12
  171. .IP NL0 8
  172. Newline type 0.
  173. .IP NL1 8
  174. Newline type 1.
  175. .RE
  176. .IP CRDLY 12
  177. Select carriage-return delays:
  178. .RS 12
  179. .IP CR0 8
  180. Carriage-return delay type 0.
  181. .IP CR1 8
  182. Carriage-return delay type 1.
  183. .IP CR2 8
  184. Carriage-return delay type 2.
  185. .IP CR3 8
  186. Carriage-return delay type 3.
  187. .RE
  188. .IP TABDLY 12
  189. Select horizontal-tab delays:
  190. .RS 12
  191. .IP TAB0 8
  192. Horizontal-tab delay type 0.
  193. .IP TAB1 8
  194. Horizontal-tab delay type 1.
  195. .IP TAB2 8
  196. Horizontal-tab delay type 2.
  197. .IP TAB3 8
  198. Expand tabs to spaces.
  199. .RE
  200. .IP BSDLY 12
  201. Select backspace delays:
  202. .RS 12
  203. .IP BS0 8
  204. Backspace-delay type 0.
  205. .IP BS1 8
  206. Backspace-delay type 1.
  207. .RE
  208. .IP VTDLY 12
  209. Select vertical-tab delays:
  210. .RS 12
  211. .IP VT0 8
  212. Vertical-tab delay type 0.
  213. .IP VT1 8
  214. Vertical-tab delay type 1.
  215. .RE
  216. .IP FFDLY 12
  217. Select form-feed delays:
  218. .RS 12
  219. .IP FF0 8
  220. Form-feed delay type 0.
  221. .IP FF1 8
  222. Form-feed delay type 1.
  223. .RE
  224. .SS "Baud Rate Selection"
  225. .P
  226. The
  227. .IR <termios.h>
  228. header shall define the following symbolic constants for use as values
  229. of objects of type
  230. .BR speed_t .
  231. .P
  232. The input and output baud rates are stored in the
  233. .BR termios
  234. structure. These are the valid values for objects of type
  235. .BR speed_t .
  236. Not all baud rates need be supported by the underlying hardware.
  237. .IP B0 12
  238. Hang up
  239. .IP B50 12
  240. 50 baud
  241. .IP B75 12
  242. 75 baud
  243. .IP B110 12
  244. 110 baud
  245. .IP B134 12
  246. 134.5 baud
  247. .IP B150 12
  248. 150 baud
  249. .IP B200 12
  250. 200 baud
  251. .IP B300 12
  252. 300 baud
  253. .IP B600 12
  254. 600 baud
  255. .IP B1200 12
  256. 1\|200 baud
  257. .IP B1800 12
  258. 1\|800 baud
  259. .IP B2400 12
  260. 2\|400 baud
  261. .IP B4800 12
  262. 4\|800 baud
  263. .IP B9600 12
  264. 9\|600 baud
  265. .IP B19200 12
  266. 19\|200 baud
  267. .IP B38400 12
  268. 38\|400 baud
  269. .SS "Control Modes"
  270. .P
  271. The
  272. .IR <termios.h>
  273. header shall define the following symbolic constants for use as flags
  274. in the
  275. .IR c_cflag
  276. field. The
  277. .IR c_cflag
  278. field describes the hardware control of the terminal; not all values
  279. specified are required to be supported by the underlying hardware.
  280. .IP CSIZE 12
  281. Character size:
  282. .RS 12
  283. .IP CS5 8
  284. 5 bits
  285. .IP CS6 8
  286. 6 bits
  287. .IP CS7 8
  288. 7 bits
  289. .IP CS8 8
  290. 8 bits
  291. .RE
  292. .IP CSTOPB 12
  293. Send two stop bits, else one.
  294. .IP CREAD 12
  295. Enable receiver.
  296. .IP PARENB 12
  297. Parity enable.
  298. .IP PARODD 12
  299. Odd parity, else even.
  300. .IP HUPCL 12
  301. Hang up on last close.
  302. .IP CLOCAL 12
  303. Ignore modem status lines.
  304. .P
  305. The implementation shall support the functionality associated with the
  306. symbols CS7, CS8, CSTOPB, PARODD, and PARENB.
  307. .SS "Local Modes"
  308. .P
  309. The
  310. .IR <termios.h>
  311. header shall define the following symbolic constants for use as flags
  312. in the
  313. .IR c_lflag
  314. field. The
  315. .IR c_lflag
  316. field of the argument structure is used to control various terminal
  317. functions.
  318. .IP ECHO 12
  319. Enable echo.
  320. .IP ECHOE 12
  321. Echo erase character as error-correcting backspace.
  322. .IP ECHOK 12
  323. Echo KILL.
  324. .IP ECHONL 12
  325. Echo NL.
  326. .IP ICANON 12
  327. Canonical input (erase and kill processing).
  328. .IP IEXTEN 12
  329. Enable extended input character processing.
  330. .IP ISIG 12
  331. Enable signals.
  332. .IP NOFLSH 12
  333. Disable flush after interrupt or quit.
  334. .IP TOSTOP 12
  335. Send SIGTTOU for background output.
  336. .SS "Attribute Selection"
  337. .P
  338. The
  339. .IR <termios.h>
  340. header shall define the following symbolic constants for use with
  341. \fItcsetattr\fR():
  342. .IP TCSANOW 12
  343. Change attributes immediately.
  344. .IP TCSADRAIN 12
  345. Change attributes when output has drained.
  346. .IP TCSAFLUSH 12
  347. Change attributes when output has drained; also flush pending input.
  348. .SS "Line Control"
  349. .P
  350. The
  351. .IR <termios.h>
  352. header shall define the following symbolic constants for use with
  353. \fItcflush\fR():
  354. .IP TCIFLUSH 12
  355. Flush pending input.
  356. .IP TCIOFLUSH 12
  357. Flush both pending input and untransmitted output.
  358. .IP TCOFLUSH 12
  359. Flush untransmitted output.
  360. .P
  361. The
  362. .IR <termios.h>
  363. header shall define the following symbolic constants for use with
  364. \fItcflow\fR():
  365. .IP TCIOFF 12
  366. Transmit a STOP character, intended to suspend input data.
  367. .IP TCION 12
  368. Transmit a START character, intended to restart input data.
  369. .IP TCOOFF 12
  370. Suspend output.
  371. .IP TCOON 12
  372. Restart output.
  373. .P
  374. The
  375. .IR <termios.h>
  376. header shall define the
  377. .BR pid_t
  378. type as described in
  379. .IR <sys/types.h> .
  380. .P
  381. The following shall be declared as functions and may also be defined
  382. as macros. Function prototypes shall be provided.
  383. .sp
  384. .RS 4
  385. .nf
  386. speed_t cfgetispeed(const struct termios *);
  387. speed_t cfgetospeed(const struct termios *);
  388. int cfsetispeed(struct termios *, speed_t);
  389. int cfsetospeed(struct termios *, speed_t);
  390. int tcdrain(int);
  391. int tcflow(int, int);
  392. int tcflush(int, int);
  393. int tcgetattr(int, struct termios *);
  394. pid_t tcgetsid(int);
  395. int tcsendbreak(int, int);
  396. int tcsetattr(int, int, const struct termios *);
  397. .fi
  398. .P
  399. .RE
  400. .LP
  401. .IR "The following sections are informative."
  402. .SH "APPLICATION USAGE"
  403. The following names are reserved for XSI-conformant systems to use as
  404. an extension to the above; therefore strictly conforming applications
  405. shall not use them:
  406. .TS
  407. tab(@);
  408. le le le.
  409. CBAUD@EXTB@VDSUSP
  410. DEFECHO@FLUSHO@VLNEXT
  411. ECHOCTL@LOBLK@VREPRINT
  412. ECHOKE@PENDIN@VSTATUS
  413. ECHOPRT@SWTCH@VWERASE
  414. EXTA@VDISCARD
  415. .TE
  416. .SH RATIONALE
  417. None.
  418. .SH "FUTURE DIRECTIONS"
  419. None.
  420. .SH "SEE ALSO"
  421. .IR "\fB<sys_types.h>\fP"
  422. .P
  423. The System Interfaces volume of POSIX.1\(hy2017,
  424. .IR "\fIcfgetispeed\fR\^(\|)",
  425. .IR "\fIcfgetospeed\fR\^(\|)",
  426. .IR "\fIcfsetispeed\fR\^(\|)",
  427. .IR "\fIcfsetospeed\fR\^(\|)",
  428. .IR "\fIconfstr\fR\^(\|)",
  429. .IR "\fItcdrain\fR\^(\|)",
  430. .IR "\fItcflow\fR\^(\|)",
  431. .IR "\fItcflush\fR\^(\|)",
  432. .IR "\fItcgetattr\fR\^(\|)",
  433. .IR "\fItcgetsid\fR\^(\|)",
  434. .IR "\fItcsendbreak\fR\^(\|)",
  435. .IR "\fItcsetattr\fR\^(\|)"
  436. .P
  437. The Shell and Utilities volume of POSIX.1\(hy2017,
  438. .IR "Chapter 11" ", " "General Terminal Interface",
  439. .IR "\fIgetconf\fR\^"
  440. .\"
  441. .SH COPYRIGHT
  442. Portions of this text are reprinted and reproduced in electronic form
  443. from IEEE Std 1003.1-2017, Standard for Information Technology
  444. -- Portable Operating System Interface (POSIX), The Open Group Base
  445. Specifications Issue 7, 2018 Edition,
  446. Copyright (C) 2018 by the Institute of
  447. Electrical and Electronics Engineers, Inc and The Open Group.
  448. In the event of any discrepancy between this version and the original IEEE and
  449. The Open Group Standard, the original IEEE and The Open Group Standard
  450. is the referee document. The original Standard can be obtained online at
  451. http://www.opengroup.org/unix/online.html .
  452. .PP
  453. Any typographical or formatting errors that appear
  454. in this page are most likely
  455. to have been introduced during the conversion of the source files to
  456. man page format. To report such errors, see
  457. https://www.kernel.org/doc/man-pages/reporting_bugs.html .