0001 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
0002
0003 .. _gen_errors:
0004
0005 *******************
0006 Generic Error Codes
0007 *******************
0008
0009
0010 .. _gen-errors:
0011
0012 .. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
0013
0014 .. flat-table:: Generic error codes
0015 :header-rows: 0
0016 :stub-columns: 0
0017 :widths: 1 16
0018
0019
0020 - - ``EAGAIN`` (aka ``EWOULDBLOCK``)
0021
0022 - The ioctl can't be handled because the device is in state where it
0023 can't perform it. This could happen for example in case where
0024 device is sleeping and ioctl is performed to query statistics. It
0025 is also returned when the ioctl would need to wait for an event,
0026 but the device was opened in non-blocking mode.
0027
0028 - - ``EBADF``
0029
0030 - The file descriptor is not a valid.
0031
0032 - - ``EBUSY``
0033
0034 - The ioctl can't be handled because the device is busy. This is
0035 typically return while device is streaming, and an ioctl tried to
0036 change something that would affect the stream, or would require
0037 the usage of a hardware resource that was already allocated. The
0038 ioctl must not be retried without performing another action to fix
0039 the problem first (typically: stop the stream before retrying).
0040
0041 - - ``EFAULT``
0042
0043 - There was a failure while copying data from/to userspace, probably
0044 caused by an invalid pointer reference.
0045
0046 - - ``EINVAL``
0047
0048 - One or more of the ioctl parameters are invalid or out of the
0049 allowed range. This is a widely used error code. See the
0050 individual ioctl requests for specific causes.
0051
0052 - - ``ENODEV``
0053
0054 - Device not found or was removed.
0055
0056 - - ``ENOMEM``
0057
0058 - There's not enough memory to handle the desired operation.
0059
0060 - - ``ENOTTY``
0061
0062 - The ioctl is not supported by the driver, actually meaning that
0063 the required functionality is not available, or the file
0064 descriptor is not for a media device.
0065
0066 - - ``ENOSPC``
0067
0068 - On USB devices, the stream ioctl's can return this error, meaning
0069 that this request would overcommit the usb bandwidth reserved for
0070 periodic transfers (up to 80% of the USB bandwidth).
0071
0072 - - ``EPERM``
0073
0074 - Permission denied. Can be returned if the device needs write
0075 permission, or some special capabilities is needed (e. g. root)
0076
0077 - - ``EIO``
0078
0079 - I/O error. Typically used when there are problems communicating with
0080 a hardware device. This could indicate broken or flaky hardware.
0081 It's a 'Something is wrong, I give up!' type of error.
0082
0083 - - ``ENXIO``
0084
0085 - No device corresponding to this device special file exists.
0086
0087
0088 .. note::
0089
0090 #. This list is not exhaustive; ioctls may return other error codes.
0091 Since errors may have side effects such as a driver reset,
0092 applications should abort on unexpected errors, or otherwise
0093 assume that the device is in a bad state.
0094
0095 #. Request-specific error codes are listed in the individual
0096 requests descriptions.