source: rtems-docs/posix-users/device_and_class_specific.rst @ 0522994

5
Last change on this file since 0522994 was 0522994, checked in by Marçal Comajoan Cara <mcomajoancara@…>, on 11/21/18 at 19:46:41

posix-users/device_and_class_specific.rst: Add Prototypes

Add and update Device and Class Specific APIs in
POSIX Users Guide.

This work was part of GCI 2018.

  • Property mode set to 100644
File size: 9.6 KB
Line 
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
7Device- and Class- Specific Functions Manager
8#############################################
9
10Introduction
11============
12
13The device- and class- specific functions manager is ...
14
15The directives provided by the device- and class- specific functions manager
16are:
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
42Background
43==========
44
45There is currently no text in this section.
46
47Operations
48==========
49
50There is currently no text in this section.
51
52Directives
53==========
54
55This section details the device- and class- specific functions manager's
56directives. A subsection is dedicated to each of this manager's directives
57and describes the calling sequence, related constants, usage,
58and status codes.
59
60.. _cfgetispeed:
61
62cfgetispeed - 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
78The ``cfgetispeed()`` function returns a code for baud rate.
79
80**DESCRIPTION:**
81
82The ``cfsetispeed()`` function stores a code for the terminal speed stored in a
83struct 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
88The ``cfsetispeed()`` function does not do anything to the hardware.  It merely
89stores a value for use by ``tcsetattr()``.
90
91**NOTES:**
92
93Baud rates are defined by symbols, such as ``B110``, ``B1200``, ``B2400``. The
94actual number returned for any given speed may change from system to system.
95
96.. _cfgetospeed:
97
98cfgetospeed - 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
114The ``cfgetospeed()`` function returns the termios code for the baud rate.
115
116**DESCRIPTION:**
117
118The ``cfgetospeed()`` function returns a code for the terminal speed stored in
119a ``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``,
122and ``B38400``.
123
124The ``cfgetospeed()`` function does not do anything to the hardware.  It merely
125returns the value stored by a previous call to ``tcgetattr()``.
126
127**NOTES:**
128
129Baud rates are defined by symbols, such as ``B110``, ``B1200``, ``B2400``. The
130actual number returned for any given speed may change from system to system.
131
132.. _cfsetispeed:
133
134cfsetispeed - 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
151The ``cfsetispeed()`` function returns a zero when successful and returns -1
152when an error occurs.
153
154**DESCRIPTION:**
155
156The ``cfsetispeed()`` function stores a code for the terminal speed stored in a
157struct 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
164This function merely stores a value in the ``termios`` structure. It does not
165change the terminal speed until a ``tcsetattr()`` is done.  It does not detect
166impossible terminal speeds.
167
168.. _cfsetospeed:
169
170cfsetospeed - 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
187The ``cfsetospeed()`` function returns a zero when successful and
188returns -1 when an error occurs.
189
190**DESCRIPTION:**
191
192The ``cfsetospeed()`` function stores a code for the terminal speed stored in a
193struct ``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``,
196and ``B38400``.
197
198The ``cfsetospeed()`` function does not do anything to the hardware. It merely
199stores a value for use by ``tcsetattr()``.
200
201**NOTES:**
202
203This function merely stores a value in the ``termios`` structure.  It does not
204change the terminal speed until a ``tcsetattr()`` is done.  It does not detect
205impossible terminal speeds.
206
207.. _tcgetattr:
208
209tcgetattr - 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
236The ``tcgetattr()`` gets the parameters associated with the terminal referred
237to by ``fildes`` and stores them into the ``termios()`` structure pointed to by
238``termios_p``.
239
240**NOTES:**
241
242NONE
243
244.. _tcsetattr:
245
246tcsetattr - 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
276tcsendbreak - 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
303This routine is not currently supported by RTEMS but could be
304in a future version.
305
306.. _tcdrain:
307
308tcdrain - 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
336The ``tcdrain()`` function waits until all output written to ``fildes`` has been
337transmitted.
338
339**NOTES:**
340
341NONE
342
343.. _tcflush:
344
345tcflush - 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
372This routine is not currently supported by RTEMS but could be in a future
373version.
374
375.. _tcflow:
376
377tcflow - 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
404This routine is not currently supported by RTEMS but could be in a future
405version.
406
407.. _tcgetpgrp:
408
409tcgetpgrp - 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
435This routine is not currently supported by RTEMS but could be in a future
436version.
437
438.. _tcsetpgrp:
439
440tcsetpgrp - 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
467This routine is not currently supported by RTEMS but could be in a future
468version.
Note: See TracBrowser for help on using the repository browser.