What we have on device.h currently is:This is proposal is very similar to what we had done originally for
/* Common Error Codes devices can provide */
#define DEV_OK 0 /* No error */
#define DEV_FAIL 1 /* General operation failure */
#define DEV_INVALID_OP 2 /* Invalid operation */
#define DEV_INVALID_CONF 3 /* Invalid configuration */
#define DEV_USED 4 /* Device controller in use */
#define DEV_NO_ACCESS 5 /* Controller not accessible */
#define DEV_NO_SUPPORT 6 /* Device type not supported */
#define DEV_NOT_CONFIG 7 /* Device not configured */
I liked Dirk's suggestion on the previous thread, so I'm gonna propose 2 quick
a- let's try to map each of this to errno codes;
b- let's document when we should return each of them.
You probably have b) ready from the other thread as well, so let me give it a
try with a).
If we get this two right, then we end up with both the guidelines for
documenting and the
transition patch Dirk suggested. After he deprecates DEV_*, moving to errno
codes will be as easy
as a few seds. So:
the devices instead of using the DEV_ names.
DEV_OK = 0
DEV_FAIL = (??)
DEV_INVALID_OP = -EPERM or -ENOTSUP (??)ESRCH
I think -ENOTSUP is a 1-1 match here:
ENOTSUP Operation not supported (POSIX.1)
Perhaps ENODEV would fit better since it device related.
DEV_INVALID_CONF = -EINVALENOTSUP
DEV_USED = -EBUSY
DEV_NO_ACCESS = -EAGAIN
DEV_NO_SUPPORT = -ENODEV or -ENXIO (??)
DEV_NOT_CONFIG = (??)EIO
DEV_NOT_IMPLEMENTED = -ENOSYS
*this last one is from your previous RFC.