Merge tag 'for-linus-5.0-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / Documentation / media / uapi / dvb / dmx-munmap.rst
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/media/uapi/fdl-appendix.rst.
7 ..
8 .. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
9
10 .. _dmx-munmap:
11
12 ************
13 DVB munmap()
14 ************
15
16 Name
17 ====
18
19 dmx-munmap - Unmap device memory
20
21 .. warning:: This API is still experimental.
22
23
24 Synopsis
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
36 Arguments
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
48 Description
49 ===========
50
51 Unmaps a previously with the :ref:`mmap() <dmx-mmap>` function mapped
52 buffer and frees it, if possible.
53
54
55 Return Value
56 ============
57
58 On success :ref:`munmap() <dmx-munmap>` returns 0, on failure -1 and the
59 ``errno`` variable is set appropriately:
60
61 EINVAL
62     The ``start`` or ``length`` is incorrect, or no buffers have been
63     mapped yet.