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

4.115
Last change on this file since 72a62ad was 72a62ad, checked in by Chris Johns <chrisj@…>, on 11/03/16 at 05:58:08

Rename all manuals with an _ to have a -. It helps released naming of files.

  • Property mode set to 100644
File size: 9.5 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    int cfgetispeed(
73        const struct 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        int cfgetospeed(
109        const struct 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 *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 *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    #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
237The ``tcgetattr()`` gets the parameters associated with the terminal referred
238to by ``fildes`` and stores them into the ``termios()`` structure pointed to by
239``termios_p``.
240
241**NOTES:**
242
243NONE
244
245.. _tcsetattr:
246
247tcsetattr - 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
278tcsendbreak - 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
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    #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
337The ``tcdrain()`` function waits until all output written to ``fildes`` has been
338transmitted.
339
340**NOTES:**
341
342NONE
343
344.. _tcflush:
345
346tcflush - 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
371This routine is not currently supported by RTEMS but could be in a future
372version.
373
374.. _tcflow:
375
376tcflow - 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
401This routine is not currently supported by RTEMS but could be in a future
402version.
403
404.. _tcgetpgrp:
405
406tcgetpgrp - 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
430This routine is not currently supported by RTEMS but could be in a future
431version.
432
433.. _tcsetpgrp:
434
435tcsetpgrp - 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
459This routine is not currently supported by RTEMS but could be in a future
460version.
Note: See TracBrowser for help on using the repository browser.