1 | .. comment SPDX-License-Identifier: CC-BY-SA-4.0 |
---|
2 | |
---|
3 | .. COMMENT: COPYRIGHT (c) 1988-2002. |
---|
4 | .. COMMENT: On-Line Applications Research Corporation (OAR). |
---|
5 | .. COMMENT: All rights reserved. |
---|
6 | |
---|
7 | Device- and Class- Specific Functions Manager |
---|
8 | ############################################# |
---|
9 | |
---|
10 | Introduction |
---|
11 | ============ |
---|
12 | |
---|
13 | The device- and class- specific functions manager is ... |
---|
14 | |
---|
15 | The directives provided by the device- and class- specific functions manager |
---|
16 | are: |
---|
17 | |
---|
18 | - cfgetispeed_ - Reads terminal input baud rate |
---|
19 | |
---|
20 | - cfgetospeed_ - Reads terminal output baud rate |
---|
21 | |
---|
22 | - cfsetispeed_ - Sets terminal input baud rate |
---|
23 | |
---|
24 | - cfsetospeed_ - Set terminal output baud rate |
---|
25 | |
---|
26 | - tcgetattr_ - Gets terminal attributes |
---|
27 | |
---|
28 | - tcsetattr_ - Set terminal attributes |
---|
29 | |
---|
30 | - tcsendbreak_ - Sends a break to a terminal |
---|
31 | |
---|
32 | - tcdrain_ - Waits for all output to be transmitted to the terminal |
---|
33 | |
---|
34 | - tcflush_ - Discards terminal data |
---|
35 | |
---|
36 | - tcflow_ - Suspends/restarts terminal output |
---|
37 | |
---|
38 | - tcgetpgrp_ - Gets foreground process group ID |
---|
39 | |
---|
40 | - tcsetpgrp_ - Sets foreground process group ID |
---|
41 | |
---|
42 | Background |
---|
43 | ========== |
---|
44 | |
---|
45 | There is currently no text in this section. |
---|
46 | |
---|
47 | Operations |
---|
48 | ========== |
---|
49 | |
---|
50 | There is currently no text in this section. |
---|
51 | |
---|
52 | Directives |
---|
53 | ========== |
---|
54 | |
---|
55 | This section details the device- and class- specific functions manager's |
---|
56 | directives. A subsection is dedicated to each of this manager's directives |
---|
57 | and describes the calling sequence, related constants, usage, |
---|
58 | and status codes. |
---|
59 | |
---|
60 | .. _cfgetispeed: |
---|
61 | |
---|
62 | cfgetispeed - Reads terminal input baud rate |
---|
63 | -------------------------------------------- |
---|
64 | .. index:: cfgetispeed |
---|
65 | .. index:: reads terminal input baud rate |
---|
66 | |
---|
67 | **CALLING SEQUENCE:** |
---|
68 | |
---|
69 | .. code-block:: c |
---|
70 | |
---|
71 | #include <termios.h> |
---|
72 | speed_t cfgetispeed( |
---|
73 | const struct termios *termios_p |
---|
74 | ); |
---|
75 | |
---|
76 | **STATUS CODES:** |
---|
77 | |
---|
78 | The ``cfgetispeed()`` function returns a code for baud rate. |
---|
79 | |
---|
80 | **DESCRIPTION:** |
---|
81 | |
---|
82 | The ``cfsetispeed()`` function stores a code for the terminal speed stored in a |
---|
83 | struct termios. The codes are defined in ``<termios.h>`` by the macros ``BO``, |
---|
84 | ``B50``, ``B75``, ``B110``, ``B134``, ``B150``, ``B200``, ``B300``, ``B600``, |
---|
85 | ``B1200``, ``B1800``, ``B2400``, ``B4800``, ``B9600``, ``B19200``, and |
---|
86 | ``B38400``. |
---|
87 | |
---|
88 | The ``cfsetispeed()`` function does not do anything to the hardware. It merely |
---|
89 | stores a value for use by ``tcsetattr()``. |
---|
90 | |
---|
91 | **NOTES:** |
---|
92 | |
---|
93 | Baud rates are defined by symbols, such as ``B110``, ``B1200``, ``B2400``. The |
---|
94 | actual number returned for any given speed may change from system to system. |
---|
95 | |
---|
96 | .. _cfgetospeed: |
---|
97 | |
---|
98 | cfgetospeed - Reads terminal output baud rate |
---|
99 | --------------------------------------------- |
---|
100 | .. index:: cfgetospeed |
---|
101 | .. index:: reads terminal output baud rate |
---|
102 | |
---|
103 | **CALLING SEQUENCE:** |
---|
104 | |
---|
105 | .. code-block:: c |
---|
106 | |
---|
107 | #include <termios.h> |
---|
108 | speed_t cfgetospeed( |
---|
109 | const struct termios *termios_p |
---|
110 | ); |
---|
111 | |
---|
112 | **STATUS CODES:** |
---|
113 | |
---|
114 | The ``cfgetospeed()`` function returns the termios code for the baud rate. |
---|
115 | |
---|
116 | **DESCRIPTION:** |
---|
117 | |
---|
118 | The ``cfgetospeed()`` function returns a code for the terminal speed stored in |
---|
119 | a ``struct termios``. The codes are defined in ``<termios.h>`` by the macros |
---|
120 | ``BO``, ``B50``, ``B75``, ``B110``, ``B134``, ``B150``, ``B200``, ``B300``, |
---|
121 | ``B600``, ``B1200``, ``B1800``, ``B2400``, ``B4800``, ``B9600``, ``B19200``, |
---|
122 | and ``B38400``. |
---|
123 | |
---|
124 | The ``cfgetospeed()`` function does not do anything to the hardware. It merely |
---|
125 | returns the value stored by a previous call to ``tcgetattr()``. |
---|
126 | |
---|
127 | **NOTES:** |
---|
128 | |
---|
129 | Baud rates are defined by symbols, such as ``B110``, ``B1200``, ``B2400``. The |
---|
130 | actual number returned for any given speed may change from system to system. |
---|
131 | |
---|
132 | .. _cfsetispeed: |
---|
133 | |
---|
134 | cfsetispeed - Sets terminal input baud rate |
---|
135 | ------------------------------------------- |
---|
136 | .. index:: cfsetispeed |
---|
137 | .. index:: sets terminal input baud rate |
---|
138 | |
---|
139 | **CALLING SEQUENCE:** |
---|
140 | |
---|
141 | .. code-block:: c |
---|
142 | |
---|
143 | #include <termios.h> |
---|
144 | int cfsetispeed( |
---|
145 | struct termios *termios_p, |
---|
146 | speed_t speed |
---|
147 | ); |
---|
148 | |
---|
149 | **STATUS CODES:** |
---|
150 | |
---|
151 | The ``cfsetispeed()`` function returns a zero when successful and returns -1 |
---|
152 | when an error occurs. |
---|
153 | |
---|
154 | **DESCRIPTION:** |
---|
155 | |
---|
156 | The ``cfsetispeed()`` function stores a code for the terminal speed stored in a |
---|
157 | struct termios. The codes are defined in ``<termios.h>`` by the macros ``BO``, |
---|
158 | ``B50``, ``B75``, ``B110``, ``B134``, ``B150``, ``B200``, ``B300``, ``B600``, |
---|
159 | ``B1200``, ``B1800``, ``B2400``, ``B4800``, ``B9600``, ``B19200``, and |
---|
160 | ``B38400``. |
---|
161 | |
---|
162 | **NOTES:** |
---|
163 | |
---|
164 | This function merely stores a value in the ``termios`` structure. It does not |
---|
165 | change the terminal speed until a ``tcsetattr()`` is done. It does not detect |
---|
166 | impossible terminal speeds. |
---|
167 | |
---|
168 | .. _cfsetospeed: |
---|
169 | |
---|
170 | cfsetospeed - Sets terminal output baud rate |
---|
171 | -------------------------------------------- |
---|
172 | .. index:: cfsetospeed |
---|
173 | .. index:: sets terminal output baud rate |
---|
174 | |
---|
175 | **CALLING SEQUENCE:** |
---|
176 | |
---|
177 | .. code-block:: c |
---|
178 | |
---|
179 | #include <termios.h> |
---|
180 | int cfsetospeed( |
---|
181 | struct termios *termios_p, |
---|
182 | speed_t speed |
---|
183 | ); |
---|
184 | |
---|
185 | **STATUS CODES:** |
---|
186 | |
---|
187 | The ``cfsetospeed()`` function returns a zero when successful and |
---|
188 | returns -1 when an error occurs. |
---|
189 | |
---|
190 | **DESCRIPTION:** |
---|
191 | |
---|
192 | The ``cfsetospeed()`` function stores a code for the terminal speed stored in a |
---|
193 | struct ``termios``. The codes are defiined in ``<termios.h>`` by the macros |
---|
194 | ``BO``, ``B50``, ``B75``, ``B110``, ``B134``, ``B150``, ``B200``, ``B300``, |
---|
195 | ``B600``, ``B1200``, ``B1800``, ``B2400``, ``B4800``, ``B9600``, ``B19200``, |
---|
196 | and ``B38400``. |
---|
197 | |
---|
198 | The ``cfsetospeed()`` function does not do anything to the hardware. It merely |
---|
199 | stores a value for use by ``tcsetattr()``. |
---|
200 | |
---|
201 | **NOTES:** |
---|
202 | |
---|
203 | This function merely stores a value in the ``termios`` structure. It does not |
---|
204 | change the terminal speed until a ``tcsetattr()`` is done. It does not detect |
---|
205 | impossible terminal speeds. |
---|
206 | |
---|
207 | .. _tcgetattr: |
---|
208 | |
---|
209 | tcgetattr - Gets terminal attributes |
---|
210 | ------------------------------------ |
---|
211 | .. index:: tcgetattr |
---|
212 | .. index:: gets terminal attributes |
---|
213 | |
---|
214 | **CALLING SEQUENCE:** |
---|
215 | |
---|
216 | .. code-block:: c |
---|
217 | |
---|
218 | #include <termios.h> |
---|
219 | int tcgetattr( |
---|
220 | int fildes, |
---|
221 | struct termios *termios_p |
---|
222 | ); |
---|
223 | |
---|
224 | **STATUS CODES:** |
---|
225 | |
---|
226 | .. list-table:: |
---|
227 | :class: rtems-table |
---|
228 | |
---|
229 | * - ``EBADF`` |
---|
230 | - Invalid file descriptor |
---|
231 | * - ``ENOOTY`` |
---|
232 | - Terminal control function attempted for a file that is not a terminal. |
---|
233 | |
---|
234 | **DESCRIPTION:** |
---|
235 | |
---|
236 | The ``tcgetattr()`` gets the parameters associated with the terminal referred |
---|
237 | to by ``fildes`` and stores them into the ``termios()`` structure pointed to by |
---|
238 | ``termios_p``. |
---|
239 | |
---|
240 | **NOTES:** |
---|
241 | |
---|
242 | NONE |
---|
243 | |
---|
244 | .. _tcsetattr: |
---|
245 | |
---|
246 | tcsetattr - Set terminal attributes |
---|
247 | ----------------------------------- |
---|
248 | .. index:: tcsetattr |
---|
249 | .. index:: set terminal attributes |
---|
250 | |
---|
251 | **CALLING SEQUENCE:** |
---|
252 | |
---|
253 | .. code-block:: c |
---|
254 | |
---|
255 | #include <termios.h> |
---|
256 | int tcsetattr( |
---|
257 | int fildes, |
---|
258 | int optional_actions, |
---|
259 | const struct termios *termios_p |
---|
260 | ); |
---|
261 | |
---|
262 | **STATUS CODES:** |
---|
263 | |
---|
264 | .. list-table:: |
---|
265 | :class: rtems-table |
---|
266 | |
---|
267 | * - ``E`` |
---|
268 | - The |
---|
269 | |
---|
270 | **DESCRIPTION:** |
---|
271 | |
---|
272 | **NOTES:** |
---|
273 | |
---|
274 | .. _tcsendbreak: |
---|
275 | |
---|
276 | tcsendbreak - Sends a break to a terminal |
---|
277 | ----------------------------------------- |
---|
278 | .. index:: tcsendbreak |
---|
279 | .. index:: sends a break to a terminal |
---|
280 | |
---|
281 | **CALLING SEQUENCE:** |
---|
282 | |
---|
283 | .. code-block:: c |
---|
284 | |
---|
285 | #include <termios.h> |
---|
286 | int tcsendbreak( |
---|
287 | int fildes, |
---|
288 | int duration |
---|
289 | ); |
---|
290 | |
---|
291 | **STATUS CODES:** |
---|
292 | |
---|
293 | .. list-table:: |
---|
294 | :class: rtems-table |
---|
295 | |
---|
296 | * - ``E`` |
---|
297 | - The |
---|
298 | |
---|
299 | **DESCRIPTION:** |
---|
300 | |
---|
301 | **NOTES:** |
---|
302 | |
---|
303 | This routine is not currently supported by RTEMS but could be |
---|
304 | in a future version. |
---|
305 | |
---|
306 | .. _tcdrain: |
---|
307 | |
---|
308 | tcdrain - Waits for all output to be transmitted to the terminal. |
---|
309 | ----------------------------------------------------------------- |
---|
310 | .. index:: tcdrain |
---|
311 | .. index:: waits for all output to be transmitted to the terminal. |
---|
312 | |
---|
313 | **CALLING SEQUENCE:** |
---|
314 | |
---|
315 | .. code-block:: c |
---|
316 | |
---|
317 | #include <termios.h> |
---|
318 | int tcdrain( |
---|
319 | int fildes |
---|
320 | ); |
---|
321 | |
---|
322 | **STATUS CODES:** |
---|
323 | |
---|
324 | .. list-table:: |
---|
325 | :class: rtems-table |
---|
326 | |
---|
327 | * - ``EBADF`` |
---|
328 | - Invalid file descriptor |
---|
329 | * - ``EINTR`` |
---|
330 | - Function was interrupted by a signal |
---|
331 | * - ``ENOTTY`` |
---|
332 | - Terminal control function attempted for a file that is not a terminal. |
---|
333 | |
---|
334 | **DESCRIPTION:** |
---|
335 | |
---|
336 | The ``tcdrain()`` function waits until all output written to ``fildes`` has been |
---|
337 | transmitted. |
---|
338 | |
---|
339 | **NOTES:** |
---|
340 | |
---|
341 | NONE |
---|
342 | |
---|
343 | .. _tcflush: |
---|
344 | |
---|
345 | tcflush - Discards terminal data |
---|
346 | -------------------------------- |
---|
347 | .. index:: tcflush |
---|
348 | .. index:: discards terminal data |
---|
349 | |
---|
350 | **CALLING SEQUENCE:** |
---|
351 | |
---|
352 | .. code-block:: c |
---|
353 | |
---|
354 | #include <termios.h> |
---|
355 | int tcflush( |
---|
356 | int fildes, |
---|
357 | int queue_selector |
---|
358 | ); |
---|
359 | |
---|
360 | **STATUS CODES:** |
---|
361 | |
---|
362 | .. list-table:: |
---|
363 | :class: rtems-table |
---|
364 | |
---|
365 | * - ``E`` |
---|
366 | - The |
---|
367 | |
---|
368 | **DESCRIPTION:** |
---|
369 | |
---|
370 | **NOTES:** |
---|
371 | |
---|
372 | This routine is not currently supported by RTEMS but could be in a future |
---|
373 | version. |
---|
374 | |
---|
375 | .. _tcflow: |
---|
376 | |
---|
377 | tcflow - Suspends/restarts terminal output. |
---|
378 | ------------------------------------------- |
---|
379 | .. index:: tcflow |
---|
380 | .. index:: suspends/restarts terminal output. |
---|
381 | |
---|
382 | **CALLING SEQUENCE:** |
---|
383 | |
---|
384 | .. code-block:: c |
---|
385 | |
---|
386 | #include <termios.h> |
---|
387 | int tcflow( |
---|
388 | int fildes, |
---|
389 | int action |
---|
390 | ); |
---|
391 | |
---|
392 | **STATUS CODES:** |
---|
393 | |
---|
394 | .. list-table:: |
---|
395 | :class: rtems-table |
---|
396 | |
---|
397 | * - ``E`` |
---|
398 | - The |
---|
399 | |
---|
400 | **DESCRIPTION:** |
---|
401 | |
---|
402 | **NOTES:** |
---|
403 | |
---|
404 | This routine is not currently supported by RTEMS but could be in a future |
---|
405 | version. |
---|
406 | |
---|
407 | .. _tcgetpgrp: |
---|
408 | |
---|
409 | tcgetpgrp - Gets foreground process group ID |
---|
410 | -------------------------------------------- |
---|
411 | .. index:: tcgetpgrp |
---|
412 | .. index:: gets foreground process group id |
---|
413 | |
---|
414 | **CALLING SEQUENCE:** |
---|
415 | |
---|
416 | .. code-block:: c |
---|
417 | |
---|
418 | #include <unistd.h> |
---|
419 | pid_t tcgetpgrp( |
---|
420 | int fildes |
---|
421 | ); |
---|
422 | |
---|
423 | **STATUS CODES:** |
---|
424 | |
---|
425 | .. list-table:: |
---|
426 | :class: rtems-table |
---|
427 | |
---|
428 | * - ``E`` |
---|
429 | - The |
---|
430 | |
---|
431 | **DESCRIPTION:** |
---|
432 | |
---|
433 | **NOTES:** |
---|
434 | |
---|
435 | This routine is not currently supported by RTEMS but could be in a future |
---|
436 | version. |
---|
437 | |
---|
438 | .. _tcsetpgrp: |
---|
439 | |
---|
440 | tcsetpgrp - Sets foreground process group ID |
---|
441 | -------------------------------------------- |
---|
442 | .. index:: tcsetpgrp |
---|
443 | .. index:: sets foreground process group id |
---|
444 | |
---|
445 | **CALLING SEQUENCE:** |
---|
446 | |
---|
447 | .. code-block:: c |
---|
448 | |
---|
449 | #include <unistd.h> |
---|
450 | int tcsetpgrp( |
---|
451 | int fildes, |
---|
452 | pid_t pgid_id |
---|
453 | ); |
---|
454 | |
---|
455 | **STATUS CODES:** |
---|
456 | |
---|
457 | .. list-table:: |
---|
458 | :class: rtems-table |
---|
459 | |
---|
460 | * - ``E`` |
---|
461 | - The |
---|
462 | |
---|
463 | **DESCRIPTION:** |
---|
464 | |
---|
465 | **NOTES:** |
---|
466 | |
---|
467 | This routine is not currently supported by RTEMS but could be in a future |
---|
468 | version. |
---|