1.. _dmx-munmap:
2
3************
4DVB munmap()
5************
6
7Name
8====
9
10dmx-munmap - Unmap device memory
11
12.. warning:: This API is still experimental.
13
14
15Synopsis
16========
17
18.. code-block:: c
19
20    #include <unistd.h>
21    #include <sys/mman.h>
22
23
24.. c:function:: int munmap( void *start, size_t length )
25    :name: dmx-munmap
26
27Arguments
28=========
29
30``start``
31    Address of the mapped buffer as returned by the
32    :ref:`mmap() <dmx-mmap>` function.
33
34``length``
35    Length of the mapped buffer. This must be the same value as given to
36    :ref:`mmap() <dmx-mmap>`.
37
38
39Description
40===========
41
42Unmaps a previously with the :ref:`mmap() <dmx-mmap>` function mapped
43buffer and frees it, if possible.
44
45
46Return Value
47============
48
49On success :ref:`munmap() <dmx-munmap>` returns 0, on failure -1 and the
50``errno`` variable is set appropriately:
51
52EINVAL
53    The ``start`` or ``length`` is incorrect, or no buffers have been
54    mapped yet.
55