dmx-querybuf.rst 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. .. _DMX_QUERYBUF:
  2. ******************
  3. ioctl DMX_QUERYBUF
  4. ******************
  5. Name
  6. ====
  7. DMX_QUERYBUF - Query the status of a buffer
  8. .. warning:: this API is still experimental
  9. Synopsis
  10. ========
  11. .. c:function:: int ioctl( int fd, DMX_QUERYBUF, struct dvb_buffer *argp )
  12. :name: DMX_QUERYBUF
  13. Arguments
  14. =========
  15. ``fd``
  16. File descriptor returned by :ref:`open() <dmx_fopen>`.
  17. ``argp``
  18. Pointer to struct :c:type:`dvb_buffer`.
  19. Description
  20. ===========
  21. This ioctl is part of the mmap streaming I/O method. It can
  22. be used to query the status of a buffer at any time after buffers have
  23. been allocated with the :ref:`DMX_REQBUFS` ioctl.
  24. Applications set the ``index`` field. Valid index numbers range from zero
  25. to the number of buffers allocated with :ref:`DMX_REQBUFS`
  26. (struct :c:type:`dvb_requestbuffers` ``count``) minus one.
  27. After calling :ref:`DMX_QUERYBUF` with a pointer to this structure,
  28. drivers return an error code or fill the rest of the structure.
  29. On success, the ``offset`` will contain the offset of the buffer from the
  30. start of the device memory, the ``length`` field its size, and the
  31. ``bytesused`` the number of bytes occupied by data in the buffer (payload).
  32. Return Value
  33. ============
  34. On success 0 is returned, the ``offset`` will contain the offset of the
  35. buffer from the start of the device memory, the ``length`` field its size,
  36. and the ``bytesused`` the number of bytes occupied by data in the buffer
  37. (payload).
  38. On error it returns -1 and the ``errno`` variable is set
  39. appropriately. The generic error codes are described at the
  40. :ref:`Generic Error Codes <gen-errors>` chapter.
  41. EINVAL
  42. The ``index`` is out of bounds.