japaric/steed

errno constants are wrong on some architectures

Closed this issue · 2 comments

Some constants, like EBADFD, have different values on different architectures:

$ rg 'define[ \t]*EBADFD'
include/uapi/asm-generic/errno.h
59:#define      EBADFD          77      /* File descriptor in bad state */

arch/sparc/include/uapi/asm/errno.h
68:#define      EBADFD          93      /* File descriptor in bad state */

arch/parisc/include/uapi/asm/errno.h
54:#define      EBADFD          168     /* File descriptor in bad state */

arch/mips/include/uapi/asm/errno.h
55:#define EBADFD               81      /* File descriptor in bad state */

arch/alpha/include/uapi/asm/errno.h
94:#define      EBADFD          114     /* File descriptor in bad state */

The implementation has to handle this using cfgs.

The architectures that usually use different values are SPARC and MIPS, which we are not currently considered supported platforms due to other bugs, so this is not a pressing issue. However, we'll have to fix this before listing those two architectures as supported.

cc @tbu-

tbu- commented

We now have mips support, but I think the errno values are still unchanged.

Indeed. It needs to be fixed. Want to look at it, @tbu-? I was planning to do it manually (replicate src/linux layout).