func-munmap.rst 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
  2. .. c:namespace:: V4L
  3. .. _func-munmap:
  4. *************
  5. V4L2 munmap()
  6. *************
  7. Name
  8. ====
  9. v4l2-munmap - Unmap device memory
  10. Synopsis
  11. ========
  12. .. code-block:: c
  13. #include <unistd.h>
  14. #include <sys/mman.h>
  15. .. c:function:: int munmap( void *start, size_t length )
  16. Arguments
  17. =========
  18. ``start``
  19. Address of the mapped buffer as returned by the
  20. :c:func:`mmap()` function.
  21. ``length``
  22. Length of the mapped buffer. This must be the same value as given to
  23. :c: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 :c:func:`mmap()` function mapped
  31. buffer and frees it, if possible.
  32. Return Value
  33. ============
  34. On success :c: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.