bytecodealliance / bytecodealliance/rustix

from_raw_os_error is inconsistent between raw and libc

Open
#1,593 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.