func-munmap.xml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <refentry id="func-munmap">
  2. <refmeta>
  3. <refentrytitle>V4L2 munmap()</refentrytitle>
  4. &manvol;
  5. </refmeta>
  6. <refnamediv>
  7. <refname>v4l2-munmap</refname>
  8. <refpurpose>Unmap device memory</refpurpose>
  9. </refnamediv>
  10. <refsynopsisdiv>
  11. <funcsynopsis>
  12. <funcsynopsisinfo>
  13. #include &lt;unistd.h&gt;
  14. #include &lt;sys/mman.h&gt;</funcsynopsisinfo>
  15. <funcprototype>
  16. <funcdef>int <function>munmap</function></funcdef>
  17. <paramdef>void *<parameter>start</parameter></paramdef>
  18. <paramdef>size_t <parameter>length</parameter></paramdef>
  19. </funcprototype>
  20. </funcsynopsis>
  21. </refsynopsisdiv>
  22. <refsect1>
  23. <title>Arguments</title>
  24. <variablelist>
  25. <varlistentry>
  26. <term><parameter>start</parameter></term>
  27. <listitem>
  28. <para>Address of the mapped buffer as returned by the
  29. &func-mmap; function.</para>
  30. </listitem>
  31. </varlistentry>
  32. <varlistentry>
  33. <term><parameter>length</parameter></term>
  34. <listitem>
  35. <para>Length of the mapped buffer. This must be the same
  36. value as given to <function>mmap()</function> and returned by the
  37. driver in the &v4l2-buffer; <structfield>length</structfield>
  38. field for the single-planar API and in the &v4l2-plane;
  39. <structfield>length</structfield> field for the multi-planar API.</para>
  40. </listitem>
  41. </varlistentry>
  42. </variablelist>
  43. </refsect1>
  44. <refsect1>
  45. <title>Description</title>
  46. <para>Unmaps a previously with the &func-mmap; function mapped
  47. buffer and frees it, if possible. <!-- ? This function (not freeing)
  48. has no impact on I/O in progress, specifically it does not imply
  49. &VIDIOC-STREAMOFF; to terminate I/O. Unmapped buffers can still be
  50. enqueued, dequeued or queried, they are just not accessible by the
  51. application.--></para>
  52. </refsect1>
  53. <refsect1>
  54. <title>Return Value</title>
  55. <para>On success <function>munmap()</function> returns 0, on
  56. failure -1 and the <varname>errno</varname> variable is set
  57. appropriately:</para>
  58. <variablelist>
  59. <varlistentry>
  60. <term><errorcode>EINVAL</errorcode></term>
  61. <listitem>
  62. <para>The <parameter>start</parameter> or
  63. <parameter>length</parameter> is incorrect, or no buffers have been
  64. mapped yet.</para>
  65. </listitem>
  66. </varlistentry>
  67. </variablelist>
  68. </refsect1>
  69. </refentry>