Mauro Carvalho Chehab | 6d17249 | 2011-07-05 10:07:37 -0300 | [diff] [blame] | 1 | <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 Chehab | dfcf4f9 | 2011-07-05 11:37:58 -0300 | [diff] [blame] | 8 | <!-- Keep it ordered alphabetically --> |
| 9 | <row> |
Hans Verkuil | 6473262 | 2012-09-21 08:32:49 -0300 | [diff] [blame] | 10 | <entry>EAGAIN (aka EWOULDBLOCK)</entry> |
Antti Palosaari | 3a35c00 | 2012-08-15 20:28:40 -0300 | [diff] [blame] | 11 | <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 Verkuil | 6473262 | 2012-09-21 08:32:49 -0300 | [diff] [blame] | 14 | 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 Palosaari | 3a35c00 | 2012-08-15 20:28:40 -0300 | [diff] [blame] | 16 | </entry> |
| 17 | </row> |
| 18 | <row> |
Mauro Carvalho Chehab | dfcf4f9 | 2011-07-05 11:37:58 -0300 | [diff] [blame] | 19 | <entry>EBADF</entry> |
Mauro Carvalho Chehab | 66b30b5 | 2011-07-06 13:42:08 -0300 | [diff] [blame] | 20 | <entry>The file descriptor is not a valid.</entry> |
Mauro Carvalho Chehab | dfcf4f9 | 2011-07-05 11:37:58 -0300 | [diff] [blame] | 21 | </row> |
Mauro Carvalho Chehab | 6d17249 | 2011-07-05 10:07:37 -0300 | [diff] [blame] | 22 | <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 Chehab | 43c1daa | 2011-07-05 11:22:28 -0300 | [diff] [blame] | 27 | 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 Chehab | dfcf4f9 | 2011-07-05 11:37:58 -0300 | [diff] [blame] | 32 | <entry>EFAULT</entry> |
Mauro Carvalho Chehab | 66b30b5 | 2011-07-06 13:42:08 -0300 | [diff] [blame] | 33 | <entry>There was a failure while copying data from/to userspace, |
| 34 | probably caused by an invalid pointer reference.</entry> |
Mauro Carvalho Chehab | dfcf4f9 | 2011-07-05 11:37:58 -0300 | [diff] [blame] | 35 | </row> |
| 36 | <row> |
Mauro Carvalho Chehab | 43c1daa | 2011-07-05 11:22:28 -0300 | [diff] [blame] | 37 | <entry>EINVAL</entry> |
Mauro Carvalho Chehab | 66b30b5 | 2011-07-06 13:42:08 -0300 | [diff] [blame] | 38 | <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 Chehab | dfcf4f9 | 2011-07-05 11:37:58 -0300 | [diff] [blame] | 41 | </row> |
| 42 | <row> |
Mauro Carvalho Chehab | b424f60 | 2011-07-05 13:18:15 -0300 | [diff] [blame] | 43 | <entry>ENODEV</entry> |
| 44 | <entry>Device not found or was removed.</entry> |
| 45 | </row> |
| 46 | <row> |
Mauro Carvalho Chehab | 43c1daa | 2011-07-05 11:22:28 -0300 | [diff] [blame] | 47 | <entry>ENOMEM</entry> |
| 48 | <entry>There's not enough memory to handle the desired operation.</entry> |
| 49 | </row> |
| 50 | <row> |
Mauro Carvalho Chehab | 9190d19 | 2011-07-06 14:08:08 -0300 | [diff] [blame] | 51 | <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 Chehab | 43c1daa | 2011-07-05 11:22:28 -0300 | [diff] [blame] | 57 | <entry>ENOSPC</entry> |
Mauro Carvalho Chehab | dfcf4f9 | 2011-07-05 11:37:58 -0300 | [diff] [blame] | 58 | <entry>On USB devices, the stream ioctl's can return this error, meaning |
Mauro Carvalho Chehab | 43c1daa | 2011-07-05 11:22:28 -0300 | [diff] [blame] | 59 | that this request would overcommit the usb bandwidth reserved |
| 60 | for periodic transfers (up to 80% of the USB bandwidth).</entry> |
Mauro Carvalho Chehab | 6d17249 | 2011-07-05 10:07:37 -0300 | [diff] [blame] | 61 | </row> |
Mauro Carvalho Chehab | c1798c9 | 2011-07-05 13:39:38 -0300 | [diff] [blame] | 62 | <row> |
Mauro Carvalho Chehab | 66b30b5 | 2011-07-06 13:42:08 -0300 | [diff] [blame] | 63 | <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 Chehab | 6d17249 | 2011-07-05 10:07:37 -0300 | [diff] [blame] | 68 | </tbody> |
| 69 | </tgroup> |
| 70 | </table> |
Mauro Carvalho Chehab | 4c14e4a | 2011-07-05 11:57:05 -0300 | [diff] [blame] | 71 | |
| 72 | <para>Note 1: ioctls may return other error codes. Since errors may have side |
| 73 | effects 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 |
| 77 | requests descriptions.</para> |