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/userspace-api/media/fdl-appendix.rst.
8 .. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
19 DMX_QUERYBUF - Query the status of a buffer
21 .. warning:: this API is still experimental
27 .. c:function:: int ioctl( int fd, DMX_QUERYBUF, struct dvb_buffer *argp )
35 File descriptor returned by :ref:`open() <dmx_fopen>`.
38 Pointer to struct :c:type:`dvb_buffer`.
44 This ioctl is part of the mmap streaming I/O method. It can
45 be used to query the status of a buffer at any time after buffers have
46 been allocated with the :ref:`DMX_REQBUFS` ioctl.
48 Applications set the ``index`` field. Valid index numbers range from zero
49 to the number of buffers allocated with :ref:`DMX_REQBUFS`
50 (struct :c:type:`dvb_requestbuffers` ``count``) minus one.
52 After calling :ref:`DMX_QUERYBUF` with a pointer to this structure,
53 drivers return an error code or fill the rest of the structure.
55 On success, the ``offset`` will contain the offset of the buffer from the
56 start of the device memory, the ``length`` field its size, and the
57 ``bytesused`` the number of bytes occupied by data in the buffer (payload).
62 On success 0 is returned, the ``offset`` will contain the offset of the
63 buffer from the start of the device memory, the ``length`` field its size,
64 and the ``bytesused`` the number of bytes occupied by data in the buffer
67 On error it returns -1 and the ``errno`` variable is set
68 appropriately. The generic error codes are described at the
69 :ref:`Generic Error Codes <gen-errors>` chapter.
72 The ``index`` is out of bounds.