• 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 close()</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="Function Reference"
17HREF="r7624.htm"><LINK
18REL="NEXT"
19TITLE="V4L2 ioctl()"
20HREF="r7667.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="r7624.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="r7667.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-CLOSE"
74></A
75>V4L2 close()</H1
76><DIV
77CLASS="REFNAMEDIV"
78><A
79NAME="AEN7630"
80></A
81><H2
82>Name</H2
83>v4l2-close&nbsp;--&nbsp;Close a V4L2 device</DIV
84><DIV
85CLASS="REFSYNOPSISDIV"
86><A
87NAME="AEN7633"
88></A
89><H2
90>Synopsis</H2
91><DIV
92CLASS="FUNCSYNOPSIS"
93><P
94></P
95><A
96NAME="AEN7634"
97></A
98><PRE
99CLASS="FUNCSYNOPSISINFO"
100>#include &lt;unistd.h&gt;</PRE
101><P
102><CODE
103><CODE
104CLASS="FUNCDEF"
105>int close</CODE
106>(int fd);</CODE
107></P
108><P
109></P
110></DIV
111></DIV
112><DIV
113CLASS="REFSECT1"
114><A
115NAME="AEN7641"
116></A
117><H2
118>Arguments</H2
119><P
120></P
121><DIV
122CLASS="VARIABLELIST"
123><DL
124><DT
125><CODE
126CLASS="PARAMETER"
127>fd</CODE
128></DT
129><DD
130><P
131>File descriptor returned by <A
132HREF="r14090.htm"
133><CODE
134CLASS="FUNCTION"
135>open()</CODE
136></A
137>.</P
138></DD
139></DL
140></DIV
141></DIV
142><DIV
143CLASS="REFSECT1"
144><A
145NAME="AEN7651"
146></A
147><H2
148>Description</H2
149><P
150>Closes the device. Any I/O in progress is terminated and
151resources associated with the file descriptor are freed. However data
152format parameters, current input or output, control values or other
153properties remain unchanged.</P
154></DIV
155><DIV
156CLASS="REFSECT1"
157><A
158NAME="AEN7654"
159></A
160><H2
161>Return Value</H2
162><P
163>The function returns <SPAN
164CLASS="RETURNVALUE"
165>0</SPAN
166> on
167success, <SPAN
168CLASS="RETURNVALUE"
169>-1</SPAN
170> on failure and the
171<CODE
172CLASS="VARNAME"
173>errno</CODE
174> is set appropriately. Possible error
175codes:</P
176><P
177></P
178><DIV
179CLASS="VARIABLELIST"
180><DL
181><DT
182><SPAN
183CLASS="ERRORCODE"
184>EBADF</SPAN
185></DT
186><DD
187><P
188><CODE
189CLASS="PARAMETER"
190>fd</CODE
191> is not a valid open file
192descriptor.</P
193></DD
194></DL
195></DIV
196></DIV
197><DIV
198CLASS="NAVFOOTER"
199><HR
200ALIGN="LEFT"
201WIDTH="100%"><TABLE
202SUMMARY="Footer navigation table"
203WIDTH="100%"
204BORDER="0"
205CELLPADDING="0"
206CELLSPACING="0"
207><TR
208><TD
209WIDTH="33%"
210ALIGN="left"
211VALIGN="top"
212><A
213HREF="r7624.htm"
214ACCESSKEY="P"
215>Prev</A
216></TD
217><TD
218WIDTH="34%"
219ALIGN="center"
220VALIGN="top"
221><A
222HREF="book1.htm"
223ACCESSKEY="H"
224>Home</A
225></TD
226><TD
227WIDTH="33%"
228ALIGN="right"
229VALIGN="top"
230><A
231HREF="r7667.htm"
232ACCESSKEY="N"
233>Next</A
234></TD
235></TR
236><TR
237><TD
238WIDTH="33%"
239ALIGN="left"
240VALIGN="top"
241>Function Reference</TD
242><TD
243WIDTH="34%"
244ALIGN="center"
245VALIGN="top"
246><A
247HREF="r7624.htm"
248ACCESSKEY="U"
249>Up</A
250></TD
251><TD
252WIDTH="33%"
253ALIGN="right"
254VALIGN="top"
255>V4L2 ioctl()</TD
256></TR
257></TABLE
258></DIV
259></BODY
260></HTML
261>
262