Mauro Carvalho Chehab | 8e080c2 | 2009-09-13 22:16:04 -0300 | [diff] [blame] | 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> |
Mauro Carvalho Chehab | 1fb0367 | 2010-12-27 08:24:58 -0300 | [diff] [blame] | 37 | <para>V4L2 ioctl request code as defined in the <filename>videodev2.h</filename> header file, for example |
Mauro Carvalho Chehab | 8e080c2 | 2009-09-13 22:16:04 -0300 | [diff] [blame] | 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 |
Mauro Carvalho Chehab | 1fb0367 | 2010-12-27 08:24:58 -0300 | [diff] [blame] | 59 | in the <filename>videodev2.h</filename> header file. |
Mauro Carvalho Chehab | 8e080c2 | 2009-09-13 22:16:04 -0300 | [diff] [blame] | 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> |
Mauro Carvalho Chehab | 4c14e4a | 2011-07-05 11:57:05 -0300 | [diff] [blame] | 67 | &return-value; |
| 68 | <para>When an ioctl that takes an output or read/write parameter fails, |
| 69 | the parameter remains unmodified.</para> |
Mauro Carvalho Chehab | 8e080c2 | 2009-09-13 22:16:04 -0300 | [diff] [blame] | 70 | </refsect1> |
| 71 | </refentry> |