1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Chapter&#160;19.&#160;Generic Error Codes</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API"><link rel="up" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API"><link rel="prev" href="media-ioc-setup-link.html" title="ioctl MEDIA_IOC_SETUP_LINK"><link rel="next" href="fdl.html" title="Appendix&#160;M.&#160;GNU Free Documentation License"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter&#160;19.&#160;Generic Error Codes</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="media-ioc-setup-link.html">Prev</a>&#160;</td><th width="60%" align="center">&#160;</th><td width="20%" align="right">&#160;<a accesskey="n" href="fdl.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="gen_errors"></a>Chapter&#160;19.&#160;Generic Error Codes</h1></div></div></div><div class="table"><a name="gen-errors"></a><p class="title"><b>Table&#160;19.1.&#160;Generic error codes</b></p><div class="table-contents"><table summary="Generic error codes" width="100%" border="0"><colgroup><col class="c1"><col class="c2"></colgroup><tbody valign="top"><tr><td valign="top">EAGAIN (aka EWOULDBLOCK)</td><td valign="top">The ioctl can't be handled because the device is in state where
2	       it can't perform it. This could happen for example in case where
3	       device is sleeping and ioctl is performed to query statistics.
4	       It is also returned when the ioctl would need to wait
5	       for an event, but the device was opened in non-blocking mode.
6	</td></tr><tr><td valign="top">EBADF</td><td valign="top">The file descriptor is not a valid.</td></tr><tr><td valign="top">EBUSY</td><td valign="top">The ioctl can't be handled because the device is busy. This is
7	       typically return while device is streaming, and an ioctl tried to
8	       change something that would affect the stream, or would require the
9	       usage of a hardware resource that was already allocated. The ioctl
10	       must not be retried without performing another action to fix the
11	       problem first (typically: stop the stream before retrying).</td></tr><tr><td valign="top">EFAULT</td><td valign="top">There was a failure while copying data from/to userspace,
12	       probably caused by an invalid pointer reference.</td></tr><tr><td valign="top">EINVAL</td><td valign="top">One or more of the ioctl parameters are invalid or out of the
13	       allowed range. This is a widely used error code. See the individual
14	       ioctl requests for specific causes.</td></tr><tr><td valign="top">ENODEV</td><td valign="top">Device not found or was removed.</td></tr><tr><td valign="top">ENOMEM</td><td valign="top">There's not enough memory to handle the desired operation.</td></tr><tr><td valign="top">ENOTTY</td><td valign="top">The ioctl is not supported by the driver, actually meaning that
15	       the required functionality is not available, or the file
16	       descriptor is not for a media device.</td></tr><tr><td valign="top">ENOSPC</td><td valign="top">On USB devices, the stream ioctl's can return this error, meaning
17	       that this request would overcommit the usb bandwidth reserved
18	       for periodic transfers (up to 80% of the USB bandwidth).</td></tr><tr><td valign="top">EPERM</td><td valign="top">Permission denied. Can be returned if the device needs write
19		permission, or some special capabilities is needed
20		(e. g. root)</td></tr></tbody></table></div></div><br class="table-break"><p>Note 1: ioctls may return other error codes. Since errors may have side
21effects such as a driver reset, applications should abort on unexpected errors.
22</p><p>Note 2: Request-specific error codes are listed in the individual
23requests descriptions.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="media-ioc-setup-link.html">Prev</a>&#160;</td><td width="20%" align="center">&#160;</td><td width="40%" align="right">&#160;<a accesskey="n" href="fdl.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ioctl MEDIA_IOC_SETUP_LINK&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;Appendix&#160;M.&#160;GNU Free Documentation License</td></tr></table></div></body></html>
24