Commit | Line | Data |
---|---|---|
5377d91f MH |
1 | .. -*- coding: utf-8; mode: rst -*- |
2 | ||
3 | .. _func-munmap: | |
4 | ||
5 | ************* | |
6 | V4L2 munmap() | |
7 | ************* | |
8 | ||
586027ce MCC |
9 | NAME |
10 | ==== | |
5377d91f | 11 | |
586027ce | 12 | v4l2-munmap - Unmap device memory |
5377d91f | 13 | |
586027ce | 14 | SYNOPSIS |
5377d91f MH |
15 | ======== |
16 | ||
17 | .. code-block:: c | |
18 | ||
19 | #include <unistd.h> | |
20 | #include <sys/mman.h> | |
21 | ||
22 | ||
b7e67f6c | 23 | .. cpp:function:: int munmap( void *start, size_t length ) |
5377d91f | 24 | |
586027ce MCC |
25 | |
26 | ARGUMENTS | |
5377d91f MH |
27 | ========= |
28 | ||
29 | ``start`` | |
30 | Address of the mapped buffer as returned by the | |
31 | :ref:`mmap() <func-mmap>` function. | |
32 | ||
33 | ``length`` | |
34 | Length of the mapped buffer. This must be the same value as given to | |
760c7010 | 35 | :ref:`mmap() <func-mmap>` and returned by the driver in the struct |
5377d91f MH |
36 | :ref:`v4l2_buffer <v4l2-buffer>` ``length`` field for the |
37 | single-planar API and in the struct | |
38 | :ref:`v4l2_plane <v4l2-plane>` ``length`` field for the | |
39 | multi-planar API. | |
40 | ||
41 | ||
586027ce | 42 | DESCRIPTION |
5377d91f MH |
43 | =========== |
44 | ||
45 | Unmaps a previously with the :ref:`mmap() <func-mmap>` function mapped | |
46 | buffer and frees it, if possible. | |
47 | ||
48 | ||
586027ce | 49 | RETURN VALUE |
5377d91f MH |
50 | ============ |
51 | ||
760c7010 | 52 | On success :ref:`munmap() <func-munmap>` returns 0, on failure -1 and the |
5377d91f MH |
53 | ``errno`` variable is set appropriately: |
54 | ||
55 | EINVAL | |
56 | The ``start`` or ``length`` is incorrect, or no buffers have been | |
57 | mapped yet. |