Add linux_to_bsd_errtbl[], mapping Linux errnos to their BSD counterparts. This will be used by fuse(4).
Details
- Reviewers
emaste asomers - Group Reviewers
Linux Emulation - Commits
- rS367339: Add linux_to_bsd_errtbl[], mapping Linux errnos to their BSD counterparts.
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/compat/linux/linux_errno.c | ||
---|---|---|
28 ↗ | (On Diff #78959) | You shouldn't assert here. If so, you'll give a buggy (or even malicious) FUSE daemon the power to crash the kernel. |
sys/compat/linux/linux_errno.h | ||
183 ↗ | (On Diff #78959) | You should wrap this line with #ifdef KERNEL. Otherwise, userspace programs may end up depending on this symbol, even though it's not guaranteed to be stable across different kernel versions. |
sys/compat/linux/linux_errno.c | ||
---|---|---|
28 ↗ | (On Diff #78959) | Perhaps EDOOFUS |
sys/compat/linux/linux_errno.c | ||
---|---|---|
40 ↗ | (On Diff #78959) | Noticed same issue in D26959, but commenting on already committed code so it could be fixed if my observation is correct. Using sizeof() this way here looks bogus, shouldn't it be either sizeof(array)/sizeof(array[0]) or simply nitems(array)? |
45 ↗ | (On Diff #78959) | Same sizeof() issue. |
sys/compat/linux/linux_errno.c | ||
---|---|---|
28 ↗ | (On Diff #78959) | Just pass errors that are outside the range AS-IS. |
sys/compat/linux/linux_errno.c | ||
---|---|---|
28 ↗ | (On Diff #78959) | This function has no consumers at this point, so I'll just remove it - it's kind of pointless to guess what the semantics should be. The table is necessary for fuse(4), but it includes linux_errno.inc directly, to avoid dependency on linux KLD. |
40 ↗ | (On Diff #78959) | D'oh! Thanks for reporting it. |
sys/compat/linux/linux_errno.c | ||
---|---|---|
18 ↗ | (On Diff #79129) | Should this code bet written like this? if (error >= 0 && error <= ELAST) return (linux_errtbl[error]); else return (XXX); |
sys/compat/linux/linux_errno.c | ||
---|---|---|
18 ↗ | (On Diff #79129) | Not really; this is for errors generated by the kernel, so we trust the error is correct. |