On 10 Apr 2017, at 21:40, Ben Harper wrote:
If nothing else, unifying around sys/defs makes sense, although currently -1 in sys/defs is mapped to SYS_ENOMEM and grepping for SYS_EUNKNOWN didn't turn anything up. I'd still like to work on the patch to get everything in line, although I'd appreciate some guidance on what for a few cases. For more specific errors like OS_BAD_MUTEX and OS_NOT_STARTED, should these be ported into sys/defs as new constants or be remapped to existing codes that may not have the same context?
In my view those are OS level codes, although I’m not sure OS_BAD_MUTEX couldn’t just be SYS_EINVAL, and OS_NOT_STARTED EBADSTATE or something like that so they map to more standard codes.
Some of the errors in os_error seem to map well onto different names under sys/defs although the names in os_error seem more descriptive. As an example case there's OS_EINVAL and OS_INVALID_PARM, they seem to have the same meaning and map to sys/defs SYS_EINVAL, but OS_INVALID_PARM is much more widely used, I'd guess for readability reasons, which usage should be carried over?
I would do EINVAL, which is a much more commonly used and understood error code. We should not be inventing our own error definitions.
Sterling
