1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>V4L2 close()</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API"><link rel="up" href="user-func.html" title="Appendix&#160;A.&#160;Function Reference"><link rel="prev" href="user-func.html" title="Appendix&#160;A.&#160;Function Reference"><link rel="next" href="func-ioctl.html" title="V4L2 ioctl()"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">V4L2 close()</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="user-func.html">Prev</a>&#160;</td><th width="60%" align="center">Appendix&#160;A.&#160;Function Reference</th><td width="20%" align="right">&#160;<a accesskey="n" href="func-ioctl.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="func-close"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>v4l2-close &#8212; Close a V4L2 device</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;unistd.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">close</b>(</code></td><td>int <var class="pdparam">fd</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1111867300"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>fd</code></em></span></dt><dd><p>File descriptor returned by <a class="link" href="func-open.html" title="V4L2 open()"><code class="function">open()</code></a>.</p></dd></dl></div></div><div class="refsect1"><a name="idp1111870108"></a><h2>Description</h2><p>Closes the device. Any I/O in progress is terminated and
2resources associated with the file descriptor are freed. However data
3format parameters, current input or output, control values or other
4properties remain unchanged.</p></div><div class="refsect1"><a name="idp1111870932"></a><h2>Return Value</h2><p>The function returns <span class="returnvalue">0</span> on
5success, <span class="returnvalue">-1</span> on failure and the
6<code class="varname">errno</code> is set appropriately. Possible error
7codes:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><span class="errorcode">EBADF</span></span></dt><dd><p><em class="parameter"><code>fd</code></em> is not a valid open file
8descriptor.</p></dd></dl></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="user-func.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="user-func.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="func-ioctl.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix&#160;A.&#160;Function Reference&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;V4L2 ioctl()</td></tr></table></div></body></html>
9