Back to home page

OSCL-LXR

 
 

    


0001 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
0002 .. c:namespace:: V4L
0003 
0004 .. _func-munmap:
0005 
0006 *************
0007 V4L2 munmap()
0008 *************
0009 
0010 Name
0011 ====
0012 
0013 v4l2-munmap - Unmap device memory
0014 
0015 Synopsis
0016 ========
0017 
0018 .. code-block:: c
0019 
0020     #include <unistd.h>
0021     #include <sys/mman.h>
0022 
0023 .. c:function:: int munmap( void *start, size_t length )
0024 
0025 Arguments
0026 =========
0027 
0028 ``start``
0029     Address of the mapped buffer as returned by the
0030     :c:func:`mmap()` function.
0031 
0032 ``length``
0033     Length of the mapped buffer. This must be the same value as given to
0034     :c:func:`mmap()` and returned by the driver in the struct
0035     :c:type:`v4l2_buffer` ``length`` field for the
0036     single-planar API and in the struct
0037     :c:type:`v4l2_plane` ``length`` field for the
0038     multi-planar API.
0039 
0040 Description
0041 ===========
0042 
0043 Unmaps a previously with the :c:func:`mmap()` function mapped
0044 buffer and frees it, if possible.
0045 
0046 Return Value
0047 ============
0048 
0049 On success :c:func:`munmap()` returns 0, on failure -1 and the
0050 ``errno`` variable is set appropriately:
0051 
0052 EINVAL
0053     The ``start`` or ``length`` is incorrect, or no buffers have been
0054     mapped yet.