Commit | Line | Data |
---|---|---|
e2460b1d MH |
1 | .. -*- coding: utf-8; mode: rst -*- |
2 | ||
3 | .. _cec-func-ioctl: | |
4 | ||
5 | *********** | |
6 | cec ioctl() | |
7 | *********** | |
8 | ||
21c62694 MH |
9 | Name |
10 | ==== | |
e2460b1d | 11 | |
21c62694 | 12 | cec-ioctl - Control a cec device |
e2460b1d MH |
13 | |
14 | Synopsis | |
15 | ======== | |
16 | ||
17 | .. code-block:: c | |
18 | ||
19 | #include <sys/ioctl.h> | |
20 | ||
21 | ||
1b81f010 | 22 | .. c:function:: int ioctl( int fd, int request, void *argp ) |
99547836 | 23 | :name: cec-ioctl |
e2460b1d MH |
24 | |
25 | Arguments | |
26 | ========= | |
27 | ||
28 | ``fd`` | |
99547836 | 29 | File descriptor returned by :c:func:`open() <cec-open>`. |
e2460b1d MH |
30 | |
31 | ``request`` | |
32 | CEC ioctl request code as defined in the cec.h header file, for | |
99547836 | 33 | example :c:func:`CEC_ADAP_G_CAPS`. |
e2460b1d MH |
34 | |
35 | ``argp`` | |
36 | Pointer to a request-specific structure. | |
37 | ||
38 | ||
39 | Description | |
40 | =========== | |
41 | ||
b6b6e678 MCC |
42 | .. note:: |
43 | ||
44 | This documents the proposed CEC API. This API is not yet finalized | |
706f8a99 | 45 | and is currently only available as a staging kernel module. |
e2460b1d MH |
46 | |
47 | The :c:func:`ioctl()` function manipulates cec device parameters. The | |
48 | argument ``fd`` must be an open file descriptor. | |
49 | ||
50 | The ioctl ``request`` code specifies the cec function to be called. It | |
51 | has encoded in it whether the argument is an input, output or read/write | |
52 | parameter, and the size of the argument ``argp`` in bytes. | |
53 | ||
54 | Macros and structures definitions specifying cec ioctl requests and | |
55 | their parameters are located in the cec.h header file. All cec ioctl | |
56 | requests, their respective function and parameters are specified in | |
57 | :ref:`cec-user-func`. | |
58 | ||
59 | ||
60 | Return Value | |
61 | ============ | |
62 | ||
63 | On success 0 is returned, on error -1 and the ``errno`` variable is set | |
64 | appropriately. The generic error codes are described at the | |
65 | :ref:`Generic Error Codes <gen-errors>` chapter. | |
66 | ||
67 | Request-specific error codes are listed in the individual requests | |
68 | descriptions. | |
69 | ||
70 | When an ioctl that takes an output or read/write parameter fails, the | |
71 | parameter remains unmodified. |