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> |
| 10 | <entry>EBADF</entry> |
Mauro Carvalho Chehab | 66b30b5 | 2011-07-06 13:42:08 -0300 | [diff] [blame^] | 11 | <entry>The file descriptor is not a valid.</entry> |
Mauro Carvalho Chehab | dfcf4f9 | 2011-07-05 11:37:58 -0300 | [diff] [blame] | 12 | </row> |
Mauro Carvalho Chehab | 6d17249 | 2011-07-05 10:07:37 -0300 | [diff] [blame] | 13 | <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 Chehab | 43c1daa | 2011-07-05 11:22:28 -0300 | [diff] [blame] | 18 | 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 Chehab | dfcf4f9 | 2011-07-05 11:37:58 -0300 | [diff] [blame] | 23 | <entry>EFAULT</entry> |
Mauro Carvalho Chehab | 66b30b5 | 2011-07-06 13:42:08 -0300 | [diff] [blame^] | 24 | <entry>There was a failure while copying data from/to userspace, |
| 25 | probably caused by an invalid pointer reference.</entry> |
Mauro Carvalho Chehab | dfcf4f9 | 2011-07-05 11:37:58 -0300 | [diff] [blame] | 26 | </row> |
| 27 | <row> |
Mauro Carvalho Chehab | 43c1daa | 2011-07-05 11:22:28 -0300 | [diff] [blame] | 28 | <entry>EINVAL</entry> |
Mauro Carvalho Chehab | 66b30b5 | 2011-07-06 13:42:08 -0300 | [diff] [blame^] | 29 | <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 Chehab | dfcf4f9 | 2011-07-05 11:37:58 -0300 | [diff] [blame] | 32 | </row> |
| 33 | <row> |
| 34 | <entry>EINVAL or ENOTTY</entry> |
Mauro Carvalho Chehab | 43c1daa | 2011-07-05 11:22:28 -0300 | [diff] [blame] | 35 | <entry>The ioctl is not supported by the driver, actually meaning that |
Mauro Carvalho Chehab | 4c14e4a | 2011-07-05 11:57:05 -0300 | [diff] [blame] | 36 | the required functionality is not available, or the file |
Mauro Carvalho Chehab | 66b30b5 | 2011-07-06 13:42:08 -0300 | [diff] [blame^] | 37 | 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 Chehab | 43c1daa | 2011-07-05 11:22:28 -0300 | [diff] [blame] | 39 | </row> |
| 40 | <row> |
Mauro Carvalho Chehab | b424f60 | 2011-07-05 13:18:15 -0300 | [diff] [blame] | 41 | <entry>ENODEV</entry> |
| 42 | <entry>Device not found or was removed.</entry> |
| 43 | </row> |
| 44 | <row> |
Mauro Carvalho Chehab | 43c1daa | 2011-07-05 11:22:28 -0300 | [diff] [blame] | 45 | <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 Chehab | dfcf4f9 | 2011-07-05 11:37:58 -0300 | [diff] [blame] | 50 | <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] | 51 | that this request would overcommit the usb bandwidth reserved |
| 52 | for periodic transfers (up to 80% of the USB bandwidth).</entry> |
Mauro Carvalho Chehab | 6d17249 | 2011-07-05 10:07:37 -0300 | [diff] [blame] | 53 | </row> |
Mauro Carvalho Chehab | c1798c9 | 2011-07-05 13:39:38 -0300 | [diff] [blame] | 54 | <row> |
Mauro Carvalho Chehab | 66b30b5 | 2011-07-06 13:42:08 -0300 | [diff] [blame^] | 55 | <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 Chehab | c1798c9 | 2011-07-05 13:39:38 -0300 | [diff] [blame] | 66 | <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 Chehab | 6d17249 | 2011-07-05 10:07:37 -0300 | [diff] [blame] | 70 | </tbody> |
| 71 | </tgroup> |
| 72 | </table> |
Mauro Carvalho Chehab | 4c14e4a | 2011-07-05 11:57:05 -0300 | [diff] [blame] | 73 | |
| 74 | <para>Note 1: ioctls may return other error codes. Since errors may have side |
| 75 | effects 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 |
| 79 | requests descriptions.</para> |