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