• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
2<HTML
3><HEAD
4><TITLE
5>V4L2 munmap()</TITLE
6><META
7NAME="GENERATOR"
8CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
9REL="HOME"
10TITLE="Video for Linux Two API Specification"
11HREF="book1.htm"><LINK
12REL="UP"
13TITLE="Function Reference"
14HREF="r7624.htm"><LINK
15REL="PREVIOUS"
16TITLE="V4L2 mmap()"
17HREF="r13889.htm"><LINK
18REL="NEXT"
19TITLE="V4L2 open()"
20HREF="r14090.htm"></HEAD
21><BODY
22CLASS="REFENTRY"
23BGCOLOR="#FFFFFF"
24TEXT="#000000"
25LINK="#0000FF"
26VLINK="#840084"
27ALINK="#0000FF"
28><DIV
29CLASS="NAVHEADER"
30><TABLE
31SUMMARY="Header navigation table"
32WIDTH="100%"
33BORDER="0"
34CELLPADDING="0"
35CELLSPACING="0"
36><TR
37><TH
38COLSPAN="3"
39ALIGN="center"
40>Video for Linux Two API Specification: Revision 0.24</TH
41></TR
42><TR
43><TD
44WIDTH="10%"
45ALIGN="left"
46VALIGN="bottom"
47><A
48HREF="r13889.htm"
49ACCESSKEY="P"
50>Prev</A
51></TD
52><TD
53WIDTH="80%"
54ALIGN="center"
55VALIGN="bottom"
56></TD
57><TD
58WIDTH="10%"
59ALIGN="right"
60VALIGN="bottom"
61><A
62HREF="r14090.htm"
63ACCESSKEY="N"
64>Next</A
65></TD
66></TR
67></TABLE
68><HR
69ALIGN="LEFT"
70WIDTH="100%"></DIV
71><H1
72><A
73NAME="FUNC-MUNMAP"
74></A
75>V4L2 munmap()</H1
76><DIV
77CLASS="REFNAMEDIV"
78><A
79NAME="AEN14041"
80></A
81><H2
82>Name</H2
83>v4l2-munmap&nbsp;--&nbsp;Unmap device memory</DIV
84><DIV
85CLASS="REFSYNOPSISDIV"
86><A
87NAME="AEN14044"
88></A
89><H2
90>Synopsis</H2
91><DIV
92CLASS="FUNCSYNOPSIS"
93><P
94></P
95><A
96NAME="AEN14045"
97></A
98><PRE
99CLASS="FUNCSYNOPSISINFO"
100>#include &lt;unistd.h&gt;
101#include &lt;sys/mman.h&gt;</PRE
102><P
103><CODE
104><CODE
105CLASS="FUNCDEF"
106>int munmap</CODE
107>(void *start, size_t length);</CODE
108></P
109><P
110></P
111></DIV
112></DIV
113><DIV
114CLASS="REFSECT1"
115><A
116NAME="AEN14054"
117></A
118><H2
119>Arguments</H2
120><P
121></P
122><DIV
123CLASS="VARIABLELIST"
124><DL
125><DT
126><CODE
127CLASS="PARAMETER"
128>start</CODE
129></DT
130><DD
131><P
132>Address of the mapped buffer as returned by the
133<A
134HREF="r13889.htm"
135><CODE
136CLASS="FUNCTION"
137>mmap()</CODE
138></A
139> function.</P
140></DD
141><DT
142><CODE
143CLASS="PARAMETER"
144>length</CODE
145></DT
146><DD
147><P
148>Length of the mapped buffer. This must be the same
149value as given to <CODE
150CLASS="FUNCTION"
151>mmap()</CODE
152> and returned by the
153driver in the struct&nbsp;<A
154HREF="x5953.htm#V4L2-BUFFER"
155>v4l2_buffer</A
156> <CODE
157CLASS="STRUCTFIELD"
158>length</CODE
159>
160field.</P
161></DD
162></DL
163></DIV
164></DIV
165><DIV
166CLASS="REFSECT1"
167><A
168NAME="AEN14072"
169></A
170><H2
171>Description</H2
172><P
173>Unmaps a previously with the <A
174HREF="r13889.htm"
175><CODE
176CLASS="FUNCTION"
177>mmap()</CODE
178></A
179> function mapped
180buffer and frees it, if possible. </P
181></DIV
182><DIV
183CLASS="REFSECT1"
184><A
185NAME="AEN14077"
186></A
187><H2
188>Return Value</H2
189><P
190>On success <CODE
191CLASS="FUNCTION"
192>munmap()</CODE
193> returns 0, on
194failure -1 and the <CODE
195CLASS="VARNAME"
196>errno</CODE
197> variable is set
198appropriately:</P
199><P
200></P
201><DIV
202CLASS="VARIABLELIST"
203><DL
204><DT
205><SPAN
206CLASS="ERRORCODE"
207>EINVAL</SPAN
208></DT
209><DD
210><P
211>The <CODE
212CLASS="PARAMETER"
213>start</CODE
214> or
215<CODE
216CLASS="PARAMETER"
217>length</CODE
218> is incorrect, or no buffers have been
219mapped yet.</P
220></DD
221></DL
222></DIV
223></DIV
224><DIV
225CLASS="NAVFOOTER"
226><HR
227ALIGN="LEFT"
228WIDTH="100%"><TABLE
229SUMMARY="Footer navigation table"
230WIDTH="100%"
231BORDER="0"
232CELLPADDING="0"
233CELLSPACING="0"
234><TR
235><TD
236WIDTH="33%"
237ALIGN="left"
238VALIGN="top"
239><A
240HREF="r13889.htm"
241ACCESSKEY="P"
242>Prev</A
243></TD
244><TD
245WIDTH="34%"
246ALIGN="center"
247VALIGN="top"
248><A
249HREF="book1.htm"
250ACCESSKEY="H"
251>Home</A
252></TD
253><TD
254WIDTH="33%"
255ALIGN="right"
256VALIGN="top"
257><A
258HREF="r14090.htm"
259ACCESSKEY="N"
260>Next</A
261></TD
262></TR
263><TR
264><TD
265WIDTH="33%"
266ALIGN="left"
267VALIGN="top"
268>V4L2 mmap()</TD
269><TD
270WIDTH="34%"
271ALIGN="center"
272VALIGN="top"
273><A
274HREF="r7624.htm"
275ACCESSKEY="U"
276>Up</A
277></TD
278><TD
279WIDTH="33%"
280ALIGN="right"
281VALIGN="top"
282>V4L2 open()</TD
283></TR
284></TABLE
285></DIV
286></BODY
287></HTML
288>
289