Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 1 | .. -*- coding: utf-8; mode: rst -*- |
| 2 | |
| 3 | .. _gen_errors: |
| 4 | |
| 5 | ******************* |
| 6 | Generic Error Codes |
| 7 | ******************* |
| 8 | |
| 9 | |
| 10 | .. _gen-errors: |
| 11 | |
| 12 | .. flat-table:: Generic error codes |
| 13 | :header-rows: 0 |
| 14 | :stub-columns: 0 |
| 15 | |
| 16 | |
| 17 | - .. row 1 |
| 18 | |
Mauro Carvalho Chehab | cdb4af0 | 2016-07-03 11:53:09 -0300 | [diff] [blame] | 19 | - ``EAGAIN`` (aka ``EWOULDBLOCK``) |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 20 | |
| 21 | - The ioctl can't be handled because the device is in state where it |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame^] | 22 | can't perform it. This could happen for example in case where |
| 23 | device is sleeping and ioctl is performed to query statistics. It |
| 24 | is also returned when the ioctl would need to wait for an event, |
| 25 | but the device was opened in non-blocking mode. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 26 | |
| 27 | - .. row 2 |
| 28 | |
Mauro Carvalho Chehab | cdb4af0 | 2016-07-03 11:53:09 -0300 | [diff] [blame] | 29 | - ``EBADF`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 30 | |
| 31 | - The file descriptor is not a valid. |
| 32 | |
| 33 | - .. row 3 |
| 34 | |
Mauro Carvalho Chehab | cdb4af0 | 2016-07-03 11:53:09 -0300 | [diff] [blame] | 35 | - ``EBUSY`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 36 | |
| 37 | - The ioctl can't be handled because the device is busy. This is |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame^] | 38 | typically return while device is streaming, and an ioctl tried to |
| 39 | change something that would affect the stream, or would require |
| 40 | the usage of a hardware resource that was already allocated. The |
| 41 | ioctl must not be retried without performing another action to fix |
| 42 | the problem first (typically: stop the stream before retrying). |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 43 | |
| 44 | - .. row 4 |
| 45 | |
Mauro Carvalho Chehab | cdb4af0 | 2016-07-03 11:53:09 -0300 | [diff] [blame] | 46 | - ``EFAULT`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 47 | |
| 48 | - There was a failure while copying data from/to userspace, probably |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame^] | 49 | caused by an invalid pointer reference. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 50 | |
| 51 | - .. row 5 |
| 52 | |
Mauro Carvalho Chehab | cdb4af0 | 2016-07-03 11:53:09 -0300 | [diff] [blame] | 53 | - ``EINVAL`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 54 | |
| 55 | - One or more of the ioctl parameters are invalid or out of the |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame^] | 56 | allowed range. This is a widely used error code. See the |
| 57 | individual ioctl requests for specific causes. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 58 | |
| 59 | - .. row 6 |
| 60 | |
Mauro Carvalho Chehab | cdb4af0 | 2016-07-03 11:53:09 -0300 | [diff] [blame] | 61 | - ``ENODEV`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 62 | |
| 63 | - Device not found or was removed. |
| 64 | |
| 65 | - .. row 7 |
| 66 | |
Mauro Carvalho Chehab | cdb4af0 | 2016-07-03 11:53:09 -0300 | [diff] [blame] | 67 | - ``ENOMEM`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 68 | |
| 69 | - There's not enough memory to handle the desired operation. |
| 70 | |
| 71 | - .. row 8 |
| 72 | |
Mauro Carvalho Chehab | cdb4af0 | 2016-07-03 11:53:09 -0300 | [diff] [blame] | 73 | - ``ENOTTY`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 74 | |
| 75 | - The ioctl is not supported by the driver, actually meaning that |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame^] | 76 | the required functionality is not available, or the file |
| 77 | descriptor is not for a media device. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 78 | |
| 79 | - .. row 9 |
| 80 | |
Mauro Carvalho Chehab | cdb4af0 | 2016-07-03 11:53:09 -0300 | [diff] [blame] | 81 | - ``ENOSPC`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 82 | |
| 83 | - On USB devices, the stream ioctl's can return this error, meaning |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame^] | 84 | that this request would overcommit the usb bandwidth reserved for |
| 85 | periodic transfers (up to 80% of the USB bandwidth). |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 86 | |
| 87 | - .. row 10 |
| 88 | |
Mauro Carvalho Chehab | cdb4af0 | 2016-07-03 11:53:09 -0300 | [diff] [blame] | 89 | - ``EPERM`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 90 | |
| 91 | - Permission denied. Can be returned if the device needs write |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame^] | 92 | permission, or some special capabilities is needed (e. g. root) |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 93 | |
| 94 | |
| 95 | Note 1: ioctls may return other error codes. Since errors may have side |
| 96 | effects such as a driver reset, applications should abort on unexpected |
| 97 | errors. |
| 98 | |
| 99 | Note 2: Request-specific error codes are listed in the individual |
| 100 | requests descriptions. |