blob: 7e29a4e1f696ec0c898fa431c4ea9163b5a12de9 [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>
Hans Verkuil64732622012-09-21 08:32:49 -030010 <entry>EAGAIN (aka EWOULDBLOCK)</entry>
Antti Palosaari3a35c002012-08-15 20:28:40 -030011 <entry>The ioctl can't be handled because the device is in state where
12 it can't perform it. This could happen for example in case where
13 device is sleeping and ioctl is performed to query statistics.
Hans Verkuil64732622012-09-21 08:32:49 -030014 It is also returned when the ioctl would need to wait
15 for an event, but the device was opened in non-blocking mode.
Antti Palosaari3a35c002012-08-15 20:28:40 -030016 </entry>
17 </row>
18 <row>
Mauro Carvalho Chehabdfcf4f92011-07-05 11:37:58 -030019 <entry>EBADF</entry>
Mauro Carvalho Chehab66b30b52011-07-06 13:42:08 -030020 <entry>The file descriptor is not a valid.</entry>
Mauro Carvalho Chehabdfcf4f92011-07-05 11:37:58 -030021 </row>
Mauro Carvalho Chehab6d172492011-07-05 10:07:37 -030022 <row>
23 <entry>EBUSY</entry>
24 <entry>The ioctl can't be handled because the device is busy. This is
25 typically return while device is streaming, and an ioctl tried to
26 change something that would affect the stream, or would require the
Mauro Carvalho Chehab43c1daa2011-07-05 11:22:28 -030027 usage of a hardware resource that was already allocated. The ioctl
28 must not be retried without performing another action to fix the
29 problem first (typically: stop the stream before retrying).</entry>
30 </row>
31 <row>
Mauro Carvalho Chehabdfcf4f92011-07-05 11:37:58 -030032 <entry>EFAULT</entry>
Mauro Carvalho Chehab66b30b52011-07-06 13:42:08 -030033 <entry>There was a failure while copying data from/to userspace,
34 probably caused by an invalid pointer reference.</entry>
Mauro Carvalho Chehabdfcf4f92011-07-05 11:37:58 -030035 </row>
36 <row>
Mauro Carvalho Chehab43c1daa2011-07-05 11:22:28 -030037 <entry>EINVAL</entry>
Mauro Carvalho Chehab66b30b52011-07-06 13:42:08 -030038 <entry>One or more of the ioctl parameters are invalid or out of the
39 allowed range. This is a widely used error code. See the individual
40 ioctl requests for specific causes.</entry>
Mauro Carvalho Chehabdfcf4f92011-07-05 11:37:58 -030041 </row>
42 <row>
Mauro Carvalho Chehabb424f602011-07-05 13:18:15 -030043 <entry>ENODEV</entry>
44 <entry>Device not found or was removed.</entry>
45 </row>
46 <row>
Mauro Carvalho Chehab43c1daa2011-07-05 11:22:28 -030047 <entry>ENOMEM</entry>
48 <entry>There's not enough memory to handle the desired operation.</entry>
49 </row>
50 <row>
Mauro Carvalho Chehab9190d192011-07-06 14:08:08 -030051 <entry>ENOTTY</entry>
52 <entry>The ioctl is not supported by the driver, actually meaning that
53 the required functionality is not available, or the file
54 descriptor is not for a media device.</entry>
55 </row>
56 <row>
Mauro Carvalho Chehab43c1daa2011-07-05 11:22:28 -030057 <entry>ENOSPC</entry>
Mauro Carvalho Chehabdfcf4f92011-07-05 11:37:58 -030058 <entry>On USB devices, the stream ioctl's can return this error, meaning
Mauro Carvalho Chehab43c1daa2011-07-05 11:22:28 -030059 that this request would overcommit the usb bandwidth reserved
60 for periodic transfers (up to 80% of the USB bandwidth).</entry>
Mauro Carvalho Chehab6d172492011-07-05 10:07:37 -030061 </row>
Mauro Carvalho Chehabc1798c92011-07-05 13:39:38 -030062 <row>
Mauro Carvalho Chehab66b30b52011-07-06 13:42:08 -030063 <entry>EPERM</entry>
64 <entry>Permission denied. Can be returned if the device needs write
65 permission, or some special capabilities is needed
66 (e. g. root)</entry>
67 </row>
Mauro Carvalho Chehab6d172492011-07-05 10:07:37 -030068 </tbody>
69 </tgroup>
70</table>
Mauro Carvalho Chehab4c14e4a2011-07-05 11:57:05 -030071
72<para>Note 1: ioctls may return other error codes. Since errors may have side
73effects such as a driver reset, applications should abort on unexpected errors.
74</para>
75
76<para>Note 2: Request-specific error codes are listed in the individual
77requests descriptions.</para>