blob: 7c1980e8747b1a3c11629f5da70431918cdcf618 [file] [log] [blame]
Mauro Carvalho Chehab6d172492011-07-05 10:07:37 -03001<title>Generic Error Codes</title>
2
3<table frame="none" pgwide="1" id="gen-errors">
4 <title>Generic error codes</title>
5 <tgroup cols="2">
6 &cs-str;
7 <tbody valign="top">
Mauro Carvalho Chehabdfcf4f92011-07-05 11:37:58 -03008 <!-- Keep it ordered alphabetically -->
9 <row>
10 <entry>EBADF</entry>
Mauro Carvalho Chehab66b30b52011-07-06 13:42:08 -030011 <entry>The file descriptor is not a valid.</entry>
Mauro Carvalho Chehabdfcf4f92011-07-05 11:37:58 -030012 </row>
Mauro Carvalho Chehab6d172492011-07-05 10:07:37 -030013 <row>
14 <entry>EBUSY</entry>
15 <entry>The ioctl can't be handled because the device is busy. This is
16 typically return while device is streaming, and an ioctl tried to
17 change something that would affect the stream, or would require the
Mauro Carvalho Chehab43c1daa2011-07-05 11:22:28 -030018 usage of a hardware resource that was already allocated. The ioctl
19 must not be retried without performing another action to fix the
20 problem first (typically: stop the stream before retrying).</entry>
21 </row>
22 <row>
Mauro Carvalho Chehabdfcf4f92011-07-05 11:37:58 -030023 <entry>EFAULT</entry>
Mauro Carvalho Chehab66b30b52011-07-06 13:42:08 -030024 <entry>There was a failure while copying data from/to userspace,
25 probably caused by an invalid pointer reference.</entry>
Mauro Carvalho Chehabdfcf4f92011-07-05 11:37:58 -030026 </row>
27 <row>
Mauro Carvalho Chehab43c1daa2011-07-05 11:22:28 -030028 <entry>EINVAL</entry>
Mauro Carvalho Chehab66b30b52011-07-06 13:42:08 -030029 <entry>One or more of the ioctl parameters are invalid or out of the
30 allowed range. This is a widely used error code. See the individual
31 ioctl requests for specific causes.</entry>
Mauro Carvalho Chehabdfcf4f92011-07-05 11:37:58 -030032 </row>
33 <row>
34 <entry>EINVAL or ENOTTY</entry>
Mauro Carvalho Chehab43c1daa2011-07-05 11:22:28 -030035 <entry>The ioctl is not supported by the driver, actually meaning that
Mauro Carvalho Chehab4c14e4a2011-07-05 11:57:05 -030036 the required functionality is not available, or the file
Mauro Carvalho Chehab66b30b52011-07-06 13:42:08 -030037 descriptor is not for a media device. The usage of EINVAL is
38 deprecated and will be fixed on a latter patch.</entry>
Mauro Carvalho Chehab43c1daa2011-07-05 11:22:28 -030039 </row>
40 <row>
Mauro Carvalho Chehabb424f602011-07-05 13:18:15 -030041 <entry>ENODEV</entry>
42 <entry>Device not found or was removed.</entry>
43 </row>
44 <row>
Mauro Carvalho Chehab43c1daa2011-07-05 11:22:28 -030045 <entry>ENOMEM</entry>
46 <entry>There's not enough memory to handle the desired operation.</entry>
47 </row>
48 <row>
49 <entry>ENOSPC</entry>
Mauro Carvalho Chehabdfcf4f92011-07-05 11:37:58 -030050 <entry>On USB devices, the stream ioctl's can return this error, meaning
Mauro Carvalho Chehab43c1daa2011-07-05 11:22:28 -030051 that this request would overcommit the usb bandwidth reserved
52 for periodic transfers (up to 80% of the USB bandwidth).</entry>
Mauro Carvalho Chehab6d172492011-07-05 10:07:37 -030053 </row>
Mauro Carvalho Chehabc1798c92011-07-05 13:39:38 -030054 <row>
Mauro Carvalho Chehab66b30b52011-07-06 13:42:08 -030055 <entry>ENOSYS or EOPNOTSUPP</entry>
56 <entry>Function not available for this device (dvb API only. Will likely
57 be replaced anytime soon by ENOTTY).</entry>
58 </row>
59 <row>
60 <entry>EPERM</entry>
61 <entry>Permission denied. Can be returned if the device needs write
62 permission, or some special capabilities is needed
63 (e. g. root)</entry>
64 </row>
65 <row>
Mauro Carvalho Chehabc1798c92011-07-05 13:39:38 -030066 <entry>EWOULDBLOCK</entry>
67 <entry>Operation would block. Used when the ioctl would need to wait
68 for an event, but the device was opened in non-blocking mode.</entry>
69 </row>
Mauro Carvalho Chehab6d172492011-07-05 10:07:37 -030070 </tbody>
71 </tgroup>
72</table>
Mauro Carvalho Chehab4c14e4a2011-07-05 11:57:05 -030073
74<para>Note 1: ioctls may return other error codes. Since errors may have side
75effects such as a driver reset, applications should abort on unexpected errors.
76</para>
77
78<para>Note 2: Request-specific error codes are listed in the individual
79requests descriptions.</para>