func-munmap.xml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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.</para>
  39. </listitem>
  40. </varlistentry>
  41. </variablelist>
  42. </refsect1>
  43. <refsect1>
  44. <title>Description</title>
  45. <para>Unmaps a previously with the &func-mmap; function mapped
  46. buffer and frees it, if possible. <!-- ? This function (not freeing)
  47. has no impact on I/O in progress, specifically it does not imply
  48. &VIDIOC-STREAMOFF; to terminate I/O. Unmapped buffers can still be
  49. enqueued, dequeued or queried, they are just not accessible by the
  50. application.--></para>
  51. </refsect1>
  52. <refsect1>
  53. <title>Return Value</title>
  54. <para>On success <function>munmap()</function> returns 0, on
  55. failure -1 and the <varname>errno</varname> variable is set
  56. appropriately:</para>
  57. <variablelist>
  58. <varlistentry>
  59. <term><errorcode>EINVAL</errorcode></term>
  60. <listitem>
  61. <para>The <parameter>start</parameter> or
  62. <parameter>length</parameter> is incorrect, or no buffers have been
  63. mapped yet.</para>
  64. </listitem>
  65. </varlistentry>
  66. </variablelist>
  67. </refsect1>
  68. </refentry>
  69. <!--
  70. Local Variables:
  71. mode: sgml
  72. sgml-parent-document: "v4l2.sgml"
  73. indent-tabs-mode: nil
  74. End:
  75. -->