gen-errors.xml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <title>Generic Error Codes</title>
  2. <table frame="none" pgwide="1" id="gen-errors">
  3. <title>Generic error codes</title>
  4. <tgroup cols="2">
  5. &cs-str;
  6. <tbody valign="top">
  7. <!-- Keep it ordered alphabetically -->
  8. <row>
  9. <entry>EAGAIN (aka EWOULDBLOCK)</entry>
  10. <entry>The ioctl can't be handled because the device is in state where
  11. it can't perform it. This could happen for example in case where
  12. device is sleeping and ioctl is performed to query statistics.
  13. It is also returned when the ioctl would need to wait
  14. for an event, but the device was opened in non-blocking mode.
  15. </entry>
  16. </row>
  17. <row>
  18. <entry>EBADF</entry>
  19. <entry>The file descriptor is not a valid.</entry>
  20. </row>
  21. <row>
  22. <entry>EBUSY</entry>
  23. <entry>The ioctl can't be handled because the device is busy. This is
  24. typically return while device is streaming, and an ioctl tried to
  25. change something that would affect the stream, or would require the
  26. usage of a hardware resource that was already allocated. The ioctl
  27. must not be retried without performing another action to fix the
  28. problem first (typically: stop the stream before retrying).</entry>
  29. </row>
  30. <row>
  31. <entry>EFAULT</entry>
  32. <entry>There was a failure while copying data from/to userspace,
  33. probably caused by an invalid pointer reference.</entry>
  34. </row>
  35. <row>
  36. <entry>EINVAL</entry>
  37. <entry>One or more of the ioctl parameters are invalid or out of the
  38. allowed range. This is a widely used error code. See the individual
  39. ioctl requests for specific causes.</entry>
  40. </row>
  41. <row>
  42. <entry>ENODEV</entry>
  43. <entry>Device not found or was removed.</entry>
  44. </row>
  45. <row>
  46. <entry>ENOMEM</entry>
  47. <entry>There's not enough memory to handle the desired operation.</entry>
  48. </row>
  49. <row>
  50. <entry>ENOTTY</entry>
  51. <entry>The ioctl is not supported by the driver, actually meaning that
  52. the required functionality is not available, or the file
  53. descriptor is not for a media device.</entry>
  54. </row>
  55. <row>
  56. <entry>ENOSPC</entry>
  57. <entry>On USB devices, the stream ioctl's can return this error, meaning
  58. that this request would overcommit the usb bandwidth reserved
  59. for periodic transfers (up to 80% of the USB bandwidth).</entry>
  60. </row>
  61. <row>
  62. <entry>EPERM</entry>
  63. <entry>Permission denied. Can be returned if the device needs write
  64. permission, or some special capabilities is needed
  65. (e. g. root)</entry>
  66. </row>
  67. </tbody>
  68. </tgroup>
  69. </table>
  70. <para>Note 1: ioctls may return other error codes. Since errors may have side
  71. effects such as a driver reset, applications should abort on unexpected errors.
  72. </para>
  73. <para>Note 2: Request-specific error codes are listed in the individual
  74. requests descriptions.</para>