bytecodealliance / bytecodealliance/rustix
from_raw_os_error is inconsistent between raw and libc
- Dominant language
- Rust
- Stars
- 2.1k
- Forks
- 294
- Avg merge
- 4h 7m
- Merged PRs (30d)
- 2
Description
Values like zero panic on raw and ignored on libc.
https://github.com/bytecodealliance/rustix/blob/c4caf5caaa7e93828a2e4a4cdba1dd0171e45717/src/backend/linux_raw/io/errno.rs#L80-L97
https://github.com/bytecodealliance/rustix/blob/c4caf5caaa7e93828a2e4a4cdba1dd0171e45717/src/backend/libc/io/errno.rs#L1107-L1109
I think this behavior should be consistent, but also panic is bad, because it is on error path, so if something goes bad (and probably rare and hardly reproducible), panic would make harder to debug such problems or result in unnecessary avoidable crashes.
Probably reset wrong value to `EINVAL` or something?
Contributor guide
Assessment
This issue has not been assessed yet.