1 .. Permission is granted to copy, distribute and/or modify this
2 .. document under the terms of the GNU Free Documentation License,
3 .. Version 1.1 or any later version published by the Free Software
4 .. Foundation, with no Invariant Sections, no Front-Cover Texts
5 .. and no Back-Cover Texts. A copy of the license is included at
6 .. Documentation/media/uapi/fdl-appendix.rst.
8 .. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
19 cec-open - Open a cec device
29 .. c:function:: int open( const char *device_name, int flags )
40 Open flags. Access mode must be ``O_RDWR``.
42 When the ``O_NONBLOCK`` flag is given, the
43 :ref:`CEC_RECEIVE <CEC_RECEIVE>` and :ref:`CEC_DQEVENT <CEC_DQEVENT>` ioctls
44 will return the ``EAGAIN`` error code when no message or event is available, and
45 ioctls :ref:`CEC_TRANSMIT <CEC_TRANSMIT>`,
46 :ref:`CEC_ADAP_S_PHYS_ADDR <CEC_ADAP_S_PHYS_ADDR>` and
47 :ref:`CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>`
50 Other flags have no effect.
56 To open a cec device applications call :c:func:`open() <cec-open>` with the
57 desired device name. The function has no side effects; the device
58 configuration remain unchanged.
60 When the device is opened in read-only mode, attempts to modify its
61 configuration will result in an error, and ``errno`` will be set to
68 :c:func:`open() <cec-open>` returns the new file descriptor on success. On error,
69 -1 is returned, and ``errno`` is set appropriately. Possible error codes
73 The requested access to the file is not allowed.
76 The process already has the maximum number of files open.
79 The system limit on the total number of open files has been reached.
82 Insufficient kernel memory was available.
85 No device corresponding to this device special file exists.