Commit | Line | Data |
---|---|---|
5377d91f MH |
1 | .. -*- coding: utf-8; mode: rst -*- |
2 | ||
3 | .. _func-munmap: | |
4 | ||
5 | ************* | |
6 | V4L2 munmap() | |
7 | ************* | |
8 | ||
9 | *man v4l2-munmap(2)* | |
10 | ||
11 | Unmap device memory | |
12 | ||
13 | ||
14 | Synopsis | |
15 | ======== | |
16 | ||
17 | .. code-block:: c | |
18 | ||
19 | #include <unistd.h> | |
20 | #include <sys/mman.h> | |
21 | ||
22 | ||
23 | .. c:function:: int munmap( void *start, size_t length ) | |
24 | ||
25 | Arguments | |
26 | ========= | |
27 | ||
28 | ``start`` | |
29 | Address of the mapped buffer as returned by the | |
30 | :ref:`mmap() <func-mmap>` function. | |
31 | ||
32 | ``length`` | |
33 | Length of the mapped buffer. This must be the same value as given to | |
34 | :c:func:`mmap()` and returned by the driver in the struct | |
35 | :ref:`v4l2_buffer <v4l2-buffer>` ``length`` field for the | |
36 | single-planar API and in the struct | |
37 | :ref:`v4l2_plane <v4l2-plane>` ``length`` field for the | |
38 | multi-planar API. | |
39 | ||
40 | ||
41 | Description | |
42 | =========== | |
43 | ||
44 | Unmaps a previously with the :ref:`mmap() <func-mmap>` function mapped | |
45 | buffer and frees it, if possible. | |
46 | ||
47 | ||
48 | Return Value | |
49 | ============ | |
50 | ||
51 | On success :c:func:`munmap()` returns 0, on failure -1 and the | |
52 | ``errno`` variable is set appropriately: | |
53 | ||
54 | EINVAL | |
55 | The ``start`` or ``length`` is incorrect, or no buffers have been | |
56 | mapped yet. | |
57 | ||
58 | ||
59 | .. ------------------------------------------------------------------------------ | |
60 | .. This file was automatically converted from DocBook-XML with the dbxml | |
61 | .. library (https://github.com/return42/sphkerneldoc). The origin XML comes | |
62 | .. from the linux kernel, refer to: | |
63 | .. | |
64 | .. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook | |
65 | .. ------------------------------------------------------------------------------ |