1 <refentry id="media-func-ioctl">
3 <refentrytitle>media ioctl()</refentrytitle>
8 <refname>media-ioctl</refname>
9 <refpurpose>Control a media device</refpurpose>
14 <funcsynopsisinfo>#include <sys/ioctl.h></funcsynopsisinfo>
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>
25 <title>Arguments</title>
29 <term><parameter>fd</parameter></term>
35 <term><parameter>request</parameter></term>
37 <para>Media ioctl request code as defined in the media.h header file,
38 for example MEDIA_IOC_SETUP_LINK.</para>
42 <term><parameter>argp</parameter></term>
44 <para>Pointer to a request-specific structure.</para>
51 <title>Description</title>
52 <para>The <function>ioctl()</function> function manipulates media device
53 parameters. The argument <parameter>fd</parameter> must be an open file
55 <para>The ioctl <parameter>request</parameter> code specifies the media
56 function to be called. It has encoded in it whether the argument is an
57 input, output or read/write parameter, and the size of the argument
58 <parameter>argp</parameter> in bytes.</para>
59 <para>Macros and structures definitions specifying media ioctl requests and
60 their parameters are located in the media.h header file. All media ioctl
61 requests, their respective function and parameters are specified in
62 <xref linkend="media-user-func" />.</para>
68 <para>Request-specific error codes are listed in the
69 individual requests descriptions.</para>
70 <para>When an ioctl that takes an output or read/write parameter fails,
71 the parameter remains unmodified.</para>