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 <sys/ioctl.h></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 38VIDIOC_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 54V4L2 devices. The argument <parameter>fd</parameter> must be an open 55file descriptor. An ioctl <parameter>request</parameter> has encoded 56in it whether the argument is an input, output or read/write 57parameter, and the size of the argument <parameter>argp</parameter> in 58bytes. Macros and defines specifying V4L2 ioctl requests are located 59in the <filename>videodev2.h</filename> header file. 60Applications should use their own copy, not include the version in the 61kernel sources on the system they compile on. All V4L2 ioctl requests, 62their 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> 72