1.. Permission is granted to copy, distribute and/or modify this
2.. document under the terms of the GNU Free Documentation License,
3.. Version 1.1 or any later version published by the Free Software
4.. Foundation, with no Invariant Sections, no Front-Cover Texts
5.. and no Back-Cover Texts. A copy of the license is included at
6.. Documentation/userspace-api/media/fdl-appendix.rst.
7..
8.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
9
10.. _dmx-munmap:
11
12************
13DVB munmap()
14************
15
16Name
17====
18
19dmx-munmap - Unmap device memory
20
21.. warning:: This API is still experimental.
22
23
24Synopsis
25========
26
27.. code-block:: c
28
29    #include <unistd.h>
30    #include <sys/mman.h>
31
32
33.. c:function:: int munmap( void *start, size_t length )
34    :name: dmx-munmap
35
36Arguments
37=========
38
39``start``
40    Address of the mapped buffer as returned by the
41    :ref:`mmap() <dmx-mmap>` function.
42
43``length``
44    Length of the mapped buffer. This must be the same value as given to
45    :ref:`mmap() <dmx-mmap>`.
46
47
48Description
49===========
50
51Unmaps a previously with the :ref:`mmap() <dmx-mmap>` function mapped
52buffer and frees it, if possible.
53
54
55Return Value
56============
57
58On success :ref:`munmap() <dmx-munmap>` returns 0, on failure -1 and the
59``errno`` variable is set appropriately:
60
61EINVAL
62    The ``start`` or ``length`` is incorrect, or no buffers have been
63    mapped yet.
64