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 v4l2-write - Write to a V4L2 device
30 .. c:function:: ssize_t write( int fd, void *buf, size_t count )
37 File descriptor returned by :ref:`open() <func-open>`.
40 Buffer with data to be written
43 Number of bytes at the buffer
48 :ref:`write() <func-write>` writes up to ``count`` bytes to the device
49 referenced by the file descriptor ``fd`` from the buffer starting at
50 ``buf``. When the hardware outputs are not active yet, this function
51 enables them. When ``count`` is zero, :ref:`write() <func-write>` returns 0
52 without any other effect.
54 When the application does not provide more data in time, the previous
55 video frame, raw VBI image, sliced VPS or WSS data is displayed again.
56 Sliced Teletext or Closed Caption data is not repeated, the driver
57 inserts a blank line instead.
63 On success, the number of bytes written are returned. Zero indicates
64 nothing was written. On error, -1 is returned, and the ``errno``
65 variable is set appropriately. In this case the next write will start at
66 the beginning of a new frame. Possible error codes are:
69 Non-blocking I/O has been selected using the
70 :ref:`O_NONBLOCK <func-open>` flag and no buffer space was
71 available to write the data immediately.
74 ``fd`` is not a valid file descriptor or is not open for writing.
77 The driver does not support multiple write streams and the device is
81 ``buf`` references an inaccessible memory area.
84 The call was interrupted by a signal before any data was written.
87 I/O error. This indicates some hardware problem.
90 The :ref:`write() <func-write>` function is not supported by this driver,
91 not on this device, or generally not on this type of device.