About Kernel Documentation Linux Kernel Contact Linux Resources Linux Blog

Documentation / DocBook / media / v4l / func-ioctl.xml




Custom Search

Based on kernel version 3.16. Page generated on 2014-08-06 21:38 EST.

1	<refentry id="func-ioctl">
2	  <refmeta>
3	    <refentrytitle>V4L2 ioctl()</refentrytitle>
4	    &manvol;
5	  </refmeta>
6	
7	  <refnamediv>
8	    <refname>v4l2-ioctl</refname>
9	    <refpurpose>Program a V4L2 device</refpurpose>
10	  </refnamediv>
11	
12	  <refsynopsisdiv>
13	    <funcsynopsis>
14	      <funcsynopsisinfo>#include &lt;sys/ioctl.h&gt;</funcsynopsisinfo>
15	      <funcprototype>
16		<funcdef>int <function>ioctl</function></funcdef>
17		<paramdef>int <parameter>fd</parameter></paramdef>
18		<paramdef>int <parameter>request</parameter></paramdef>
19		<paramdef>void *<parameter>argp</parameter></paramdef>
20	      </funcprototype>
21	    </funcsynopsis>
22	  </refsynopsisdiv>
23	
24	  <refsect1>
25	    <title>Arguments</title>
26	
27	    <variablelist>
28	      <varlistentry>
29		<term><parameter>fd</parameter></term>
30		<listitem>
31		  <para>&fd;</para>
32		</listitem>
33	      </varlistentry>
34	      <varlistentry>
35		<term><parameter>request</parameter></term>
36		<listitem>
37		  <para>V4L2 ioctl request code as defined in the <filename>videodev2.h</filename> header file, for example
38	VIDIOC_QUERYCAP.</para>
39		</listitem>
40	      </varlistentry>
41	      <varlistentry>
42		<term><parameter>argp</parameter></term>
43		<listitem>
44		  <para>Pointer to a function parameter, usually a structure.</para>
45		</listitem>
46	      </varlistentry>
47	    </variablelist>
48	  </refsect1>
49	
50	  <refsect1>
51	    <title>Description</title>
52	
53	    <para>The <function>ioctl()</function> function is used to program
54	V4L2 devices. The argument <parameter>fd</parameter> must be an open
55	file descriptor. An ioctl <parameter>request</parameter> has encoded
56	in it whether the argument is an input, output or read/write
57	parameter, and the size of the argument <parameter>argp</parameter> in
58	bytes. Macros and defines specifying V4L2 ioctl requests are located
59	in the <filename>videodev2.h</filename> header file.
60	Applications should use their own copy, not include the version in the
61	kernel sources on the system they compile on. All V4L2 ioctl requests,
62	their respective function and parameters are specified in <xref
63		linkend="user-func" />.</para>
64	  </refsect1>
65	
66	  <refsect1>
67	    &return-value;
68	    <para>When an ioctl that takes an output or read/write parameter fails,
69	    the parameter remains unmodified.</para>
70	  </refsect1>
71	</refentry>
Hide Line Numbers
About Kernel Documentation Linux Kernel Contact Linux Resources Linux Blog

Information is copyright its respective author. All material is available from the Linux Kernel Source distributed under a GPL License. This page is provided as a free service by mjmwired.net.