Add defines for Linux errno values and use them to make linux_errtbl[] more readable. While here, add linux_check_errtbl()
function to make sure we don't leave holes.
Details
- Reviewers
emaste - Group Reviewers
Linux Emulation - Commits
- rS367132: Add defines for Linux errno values and use them to make linux_errtbl[]
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/compat/linux/linux_errno.h | ||
---|---|---|
5 ↗ | (On Diff #78813) | We don't really need this line anymore. :-) |
I'd prefer to leave them in; they were quite useful when writing this, and are still useful if you want to look up errno by value.
sys/compat/linux/linux_errno.c | ||
---|---|---|
31 ↗ | (On Diff #78813) | I'd like to get rid of the minus signs in subsequent commit. |
sys/compat/linux/linux_errno.h | ||
5 ↗ | (On Diff #78813) | Thanks, I'll remove it :-) |
81 ↗ | (On Diff #78813) | Sure, something like "/* XXX: in Linux this errno value is not defined */"? |
sys/compat/linux/linux_errno.h | ||
---|---|---|
81 ↗ | (On Diff #78813) | Actually, with that said why do we provide a define for it? What about e.g. /* XXX errno 41 unused in Linux */ |
sys/compat/linux/linux_errno.inc | ||
119 ↗ | (On Diff #78813) | These comments were necessary before because it wasn't clear which FreeBSD and Linux errnos are involved, but now it just repeats what the code clearly shows. I think it is still useful to call out discrepancies, but IMO we ought to instead explain why we chose the mapping. EPROCLIM Too many processes. EAGAIN Resource temporarily unavailable. This is a temporary condition and later calls to the same routine may complete normally. |
sys/compat/linux/linux_errno.h | ||
---|---|---|
81 ↗ | (On Diff #78813) | It will be required for subsequent commit which adds Linux->FreeBSD mapping. |
sys/compat/linux/linux_errno.inc | ||
---|---|---|
119 ↗ | (On Diff #78813) | In this particular case I have no idea why the mapping is like this. I just preserved the comments, and added them to point out discrepancies which were previously undocumented. In other words: I agree we should revisit them, but for now it's just maintaining status quo. |
sys/compat/linux/linux_errno.h | ||
---|---|---|
81 ↗ | (On Diff #78813) | Ah, so you are going to make an inverse table using the same defines. SEEMSUNUSED and ALSOUNUSED seem odd though. How about LINUX_EUNUSED_41 and LINUX_EUNUSED_58 |
sys/compat/linux/linux_errno.inc | ||
119 ↗ | (On Diff #78813) | Sure, but you can drop the "X -> Y" from the comment, just leave an XXX to highlight it |
lib/libsysdecode/errno.c | ||
---|---|---|
40 ↗ | (On Diff #78868) | the static seems odd there |
Isn't errno different in linux on different architectures? I know that at least alpha had a very different errno than x86..
It is; at some point we might need to move this into architecture-specific include. Unless Linux folks managed to fix it for newer architectures, in which case we won’t.