Path: blob/master/Documentation/DocBook/v4l/func-munmap.xml
10821 views
<refentry id="func-munmap">1<refmeta>2<refentrytitle>V4L2 munmap()</refentrytitle>3&manvol;4</refmeta>56<refnamediv>7<refname>v4l2-munmap</refname>8<refpurpose>Unmap device memory</refpurpose>9</refnamediv>1011<refsynopsisdiv>12<funcsynopsis>13<funcsynopsisinfo>14#include <unistd.h>15#include <sys/mman.h></funcsynopsisinfo>16<funcprototype>17<funcdef>int <function>munmap</function></funcdef>18<paramdef>void *<parameter>start</parameter></paramdef>19<paramdef>size_t <parameter>length</parameter></paramdef>20</funcprototype>21</funcsynopsis>22</refsynopsisdiv>23<refsect1>24<title>Arguments</title>25<variablelist>26<varlistentry>27<term><parameter>start</parameter></term>28<listitem>29<para>Address of the mapped buffer as returned by the30&func-mmap; function.</para>31</listitem>32</varlistentry>33<varlistentry>34<term><parameter>length</parameter></term>35<listitem>36<para>Length of the mapped buffer. This must be the same37value as given to <function>mmap()</function> and returned by the38driver in the &v4l2-buffer; <structfield>length</structfield>39field for the single-planar API and in the &v4l2-plane;40<structfield>length</structfield> field for the multi-planar API.</para>41</listitem>42</varlistentry>43</variablelist>44</refsect1>4546<refsect1>47<title>Description</title>4849<para>Unmaps a previously with the &func-mmap; function mapped50buffer and frees it, if possible. <!-- ? This function (not freeing)51has no impact on I/O in progress, specifically it does not imply52&VIDIOC-STREAMOFF; to terminate I/O. Unmapped buffers can still be53enqueued, dequeued or queried, they are just not accessible by the54application.--></para>55</refsect1>5657<refsect1>58<title>Return Value</title>5960<para>On success <function>munmap()</function> returns 0, on61failure -1 and the <varname>errno</varname> variable is set62appropriately:</para>6364<variablelist>65<varlistentry>66<term><errorcode>EINVAL</errorcode></term>67<listitem>68<para>The <parameter>start</parameter> or69<parameter>length</parameter> is incorrect, or no buffers have been70mapped yet.</para>71</listitem>72</varlistentry>73</variablelist>74</refsect1>75</refentry>7677<!--78Local Variables:79mode: sgml80sgml-parent-document: "v4l2.sgml"81indent-tabs-mode: nil82End:83-->848586