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.
42 The :c:func:`ioctl()` function manipulates cec device parameters. The
43 argument ``fd`` must be an open file descriptor.
45 The ioctl ``request`` code specifies the cec function to be called. It
46 has encoded in it whether the argument is an input, output or read/write
47 parameter, and the size of the argument ``argp`` in bytes.
49 Macros and structures definitions specifying cec ioctl requests and
50 their parameters are located in the cec.h header file. All cec ioctl
51 requests, their respective function and parameters are specified in
58 On success 0 is returned, on error -1 and the ``errno`` variable is set
59 appropriately. The generic error codes are described at the
60 :ref:`Generic Error Codes <gen-errors>` chapter.
62 Request-specific error codes are listed in the individual requests
65 When an ioctl that takes an output or read/write parameter fails, the
66 parameter remains unmodified.