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 | int cfgetispeed( |
---|
73 | const struct 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 | int cfgetospeed( |
---|
109 | const struct 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 *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 *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 | #include <unistd.h> |
---|
220 | int tcgetattr( |
---|
221 | int fildes, |
---|
222 | struct termios *p |
---|
223 | ); |
---|
224 | |
---|
225 | **STATUS CODES:** |
---|
226 | |
---|
227 | .. list-table:: |
---|
228 | :class: rtems-table |
---|
229 | |
---|
230 | * - ``EBADF`` |
---|
231 | - Invalid file descriptor |
---|
232 | * - ``ENOOTY`` |
---|
233 | - Terminal control function attempted for a file that is not a terminal. |
---|
234 | |
---|
235 | **DESCRIPTION:** |
---|
236 | |
---|
237 | The ``tcgetattr()`` gets the parameters associated with the terminal referred |
---|
238 | to by ``fildes`` and stores them into the ``termios()`` structure pointed to by |
---|
239 | ``termios_p``. |
---|
240 | |
---|
241 | **NOTES:** |
---|
242 | |
---|
243 | NONE |
---|
244 | |
---|
245 | .. _tcsetattr: |
---|
246 | |
---|
247 | tcsetattr - Set terminal attributes |
---|
248 | ----------------------------------- |
---|
249 | .. index:: tcsetattr |
---|
250 | .. index:: set terminal attributes |
---|
251 | |
---|
252 | **CALLING SEQUENCE:** |
---|
253 | |
---|
254 | .. code-block:: c |
---|
255 | |
---|
256 | #include <termios.h> |
---|
257 | #include <unistd.h> |
---|
258 | int tcsetattr( |
---|
259 | int fildes, |
---|
260 | int options, |
---|
261 | const struct termios *tp |
---|
262 | ); |
---|
263 | |
---|
264 | **STATUS CODES:** |
---|
265 | |
---|
266 | .. list-table:: |
---|
267 | :class: rtems-table |
---|
268 | |
---|
269 | * - ``E`` |
---|
270 | - The |
---|
271 | |
---|
272 | **DESCRIPTION:** |
---|
273 | |
---|
274 | **NOTES:** |
---|
275 | |
---|
276 | .. _tcsendbreak: |
---|
277 | |
---|
278 | tcsendbreak - Sends a break to a terminal |
---|
279 | ----------------------------------------- |
---|
280 | .. index:: tcsendbreak |
---|
281 | .. index:: sends a break to a terminal |
---|
282 | |
---|
283 | **CALLING SEQUENCE:** |
---|
284 | |
---|
285 | .. code-block:: c |
---|
286 | |
---|
287 | int tcsendbreak( |
---|
288 | int fd |
---|
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 | #include <unistd.h> |
---|
319 | int tcdrain( |
---|
320 | int fildes |
---|
321 | ); |
---|
322 | |
---|
323 | **STATUS CODES:** |
---|
324 | |
---|
325 | .. list-table:: |
---|
326 | :class: rtems-table |
---|
327 | |
---|
328 | * - ``EBADF`` |
---|
329 | - Invalid file descriptor |
---|
330 | * - ``EINTR`` |
---|
331 | - Function was interrupted by a signal |
---|
332 | * - ``ENOTTY`` |
---|
333 | - Terminal control function attempted for a file that is not a terminal. |
---|
334 | |
---|
335 | **DESCRIPTION:** |
---|
336 | |
---|
337 | The ``tcdrain()`` function waits until all output written to ``fildes`` has been |
---|
338 | transmitted. |
---|
339 | |
---|
340 | **NOTES:** |
---|
341 | |
---|
342 | NONE |
---|
343 | |
---|
344 | .. _tcflush: |
---|
345 | |
---|
346 | tcflush - Discards terminal data |
---|
347 | -------------------------------- |
---|
348 | .. index:: tcflush |
---|
349 | .. index:: discards terminal data |
---|
350 | |
---|
351 | **CALLING SEQUENCE:** |
---|
352 | |
---|
353 | .. code-block:: c |
---|
354 | |
---|
355 | int tcflush( |
---|
356 | int fd |
---|
357 | ); |
---|
358 | |
---|
359 | **STATUS CODES:** |
---|
360 | |
---|
361 | .. list-table:: |
---|
362 | :class: rtems-table |
---|
363 | |
---|
364 | * - ``E`` |
---|
365 | - The |
---|
366 | |
---|
367 | **DESCRIPTION:** |
---|
368 | |
---|
369 | **NOTES:** |
---|
370 | |
---|
371 | This routine is not currently supported by RTEMS but could be in a future |
---|
372 | version. |
---|
373 | |
---|
374 | .. _tcflow: |
---|
375 | |
---|
376 | tcflow - Suspends/restarts terminal output. |
---|
377 | ------------------------------------------- |
---|
378 | .. index:: tcflow |
---|
379 | .. index:: suspends/restarts terminal output. |
---|
380 | |
---|
381 | **CALLING SEQUENCE:** |
---|
382 | |
---|
383 | .. code-block:: c |
---|
384 | |
---|
385 | int tcflow( |
---|
386 | int fd |
---|
387 | ); |
---|
388 | |
---|
389 | **STATUS CODES:** |
---|
390 | |
---|
391 | .. list-table:: |
---|
392 | :class: rtems-table |
---|
393 | |
---|
394 | * - ``E`` |
---|
395 | - The |
---|
396 | |
---|
397 | **DESCRIPTION:** |
---|
398 | |
---|
399 | **NOTES:** |
---|
400 | |
---|
401 | This routine is not currently supported by RTEMS but could be in a future |
---|
402 | version. |
---|
403 | |
---|
404 | .. _tcgetpgrp: |
---|
405 | |
---|
406 | tcgetpgrp - Gets foreground process group ID |
---|
407 | -------------------------------------------- |
---|
408 | .. index:: tcgetpgrp |
---|
409 | .. index:: gets foreground process group id |
---|
410 | |
---|
411 | **CALLING SEQUENCE:** |
---|
412 | |
---|
413 | .. code-block:: c |
---|
414 | |
---|
415 | int tcgetpgrp( |
---|
416 | ); |
---|
417 | |
---|
418 | **STATUS CODES:** |
---|
419 | |
---|
420 | .. list-table:: |
---|
421 | :class: rtems-table |
---|
422 | |
---|
423 | * - ``E`` |
---|
424 | - The |
---|
425 | |
---|
426 | **DESCRIPTION:** |
---|
427 | |
---|
428 | **NOTES:** |
---|
429 | |
---|
430 | This routine is not currently supported by RTEMS but could be in a future |
---|
431 | version. |
---|
432 | |
---|
433 | .. _tcsetpgrp: |
---|
434 | |
---|
435 | tcsetpgrp - Sets foreground process group ID |
---|
436 | -------------------------------------------- |
---|
437 | .. index:: tcsetpgrp |
---|
438 | .. index:: sets foreground process group id |
---|
439 | |
---|
440 | **CALLING SEQUENCE:** |
---|
441 | |
---|
442 | .. code-block:: c |
---|
443 | |
---|
444 | int tcsetpgrp( |
---|
445 | ); |
---|
446 | |
---|
447 | **STATUS CODES:** |
---|
448 | |
---|
449 | .. list-table:: |
---|
450 | :class: rtems-table |
---|
451 | |
---|
452 | * - ``E`` |
---|
453 | - The |
---|
454 | |
---|
455 | **DESCRIPTION:** |
---|
456 | |
---|
457 | **NOTES:** |
---|
458 | |
---|
459 | This routine is not currently supported by RTEMS but could be in a future |
---|
460 | version. |
---|