source: rtems-docs/posix-users/devctl.rst @ 42d50d7

5
Last change on this file since 42d50d7 was ca2926f, checked in by Joel Sherrill <joel@…>, on 03/10/17 at 21:01:36

POSIX Users: Add posix_devctl()

  • Property mode set to 100644
File size: 1.8 KB
Line 
1.. comment SPDX-License-Identifier: CC-BY-SA-4.0
2
3.. COMMENT: COPYRIGHT(c) 2017.
4.. COMMENT: On-Line Applications Research Corporation(OAR).
5.. COMMENT: All rights reserved.
6
7Device Control
8##############
9
10Introduction
11============
12
13The POSIX Device Control API is defined by POSIX 1003.26 and attempts
14to provides a portable alternative to the ioctl() service which is
15not standardized across POSIX implementations.  Support for this
16standard is required by the Open Group's FACE Technical Standard
17:cits:"FACE:2012:FTS".  Unfortunately, this part of the POSIX standard
18is not widely implemented.
19
20The services provided by the timer manager are:
21
22- posix_devctl_ - Control a Device
23
24Background
25==========
26
27Operations
28==========
29
30System Calls
31============
32
33This section details the POSIX device control's services.  A subsection
34is dedicated to each of this manager's services and describes the calling
35sequence, related constants, usage, and status codes.
36
37.. COMMENT: posix_devctl
38
39.. _posix_devctl
40
41posix_devctl - Control a Device
42-------------------------------
43
44**CALLING SEQUENCE:**
45
46.. code-block:: c
47
48    #include <devctl.h>
49    int posix_devctl(
50      int            fd,
51      int            dcmd,
52      void *restrict dev_data_ptr,
53      size_t         nbyte,
54      int *restrict  dev_info_ptr
55    );
56
57**STATUS CODES:**
58
59The status codes returned reflect those returned by the ``ioctl()`` service
60and the underlying device drivers.
61
62**DESCRIPTION:**
63
64This method is intended to be a portable alternative to the ``ioctl()``
65method. The RTEMS implementation follows what is referred to as a library
66implementation which is a simple wrapper for the ``ioctl()`` method.
67The fd, fcmd, dev_data_ptr, and nbyte parameters are passed unmodified
68to the ``ioctl()`` method.
69
70If the dev_info_ptr parameter is not NULL, then the location pointed
71to by dev_info_ptr is set to 0.
72
73**NOTES:**
74
75NONE
Note: See TracBrowser for help on using the repository browser.