func-munmap.rst 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. .. -*- coding: utf-8; mode: rst -*-
  2. .. _func-munmap:
  3. *************
  4. V4L2 munmap()
  5. *************
  6. Name
  7. ====
  8. v4l2-munmap - Unmap device memory
  9. Synopsis
  10. ========
  11. .. code-block:: c
  12. #include <unistd.h>
  13. #include <sys/mman.h>
  14. .. c:function:: int munmap( void *start, size_t length )
  15. :name: v4l2-munmap
  16. Arguments
  17. =========
  18. ``start``
  19. Address of the mapped buffer as returned by the
  20. :ref:`mmap() <func-mmap>` function.
  21. ``length``
  22. Length of the mapped buffer. This must be the same value as given to
  23. :ref:`mmap() <func-mmap>` and returned by the driver in the struct
  24. :c:type:`v4l2_buffer` ``length`` field for the
  25. single-planar API and in the struct
  26. :c:type:`v4l2_plane` ``length`` field for the
  27. multi-planar API.
  28. Description
  29. ===========
  30. Unmaps a previously with the :ref:`mmap() <func-mmap>` function mapped
  31. buffer and frees it, if possible.
  32. Return Value
  33. ============
  34. On success :ref:`munmap() <func-munmap>` returns 0, on failure -1 and the
  35. ``errno`` variable is set appropriately:
  36. EINVAL
  37. The ``start`` or ``length`` is incorrect, or no buffers have been
  38. mapped yet.