rustix 0.30.0

Safe Rust bindings to POSIX/Unix/Linux/Winsock2-like syscalls
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#[test]
fn test_error() {
    assert_eq!(
        rustix::io::Error::INVAL,
        rustix::io::Error::from_raw_os_error(rustix::io::Error::INVAL.raw_os_error())
    );
    #[cfg(not(windows))]
    assert_eq!(rustix::io::Error::INVAL.raw_os_error(), libc::EINVAL);
    #[cfg(windows)]
    assert_eq!(
        rustix::io::Error::INVAL.raw_os_error(),
        winapi::um::winsock2::WSAEINVAL
    );
}