demikernel
demikernel copied to clipboard
[catnap] ambiguous use of Fail::errno for Windows
Description
The catnap runtime for Windows uses socket2 for underlying I/O. This crate indicates errors with the std::io::Error type, which relies upon the Rust-specific ErrorKind enum. Several sites in the code (such as catnap/socket.rs method try_pop) coerce the ErrorKind value into the error constructor. It seems the desired behavior is to use Fail's From<io::Error> trait.
How to Reproduce
Cause any failure condition on a Windows/catnap setup. The returned Err(e), e.errno will be an ErrorKind value.
Expected Behavior
Ideally we would translate the I/O error kind into a valid errno; however, even using the EIO code with the correct cause would improve correctness.
Related Issues
Possibly #344