func-ioctl.xml 2.2 KB

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