1 .. -*- coding: utf-8; mode: rst -*-
12 cec-ioctl - Control a cec device
19 #include <sys/ioctl.h>
22 .. c:function:: int ioctl( int fd, int request, void *argp )
29 File descriptor returned by :c:func:`open() <cec-open>`.
32 CEC ioctl request code as defined in the cec.h header file, for
33 example :c:func:`CEC_ADAP_G_CAPS`.
36 Pointer to a request-specific structure.
44 This documents the proposed CEC API. This API is not yet finalized
45 and is currently only available as a staging kernel module.
47 The :c:func:`ioctl()` function manipulates cec device parameters. The
48 argument ``fd`` must be an open file descriptor.
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.
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
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.
67 Request-specific error codes are listed in the individual requests
70 When an ioctl that takes an output or read/write parameter fails, the
71 parameter remains unmodified.