https://github.com/rust-lang/rust/blob/5660db2508159513e0ade032ae9349977e7371b5/src/libnative/io/file_unix.rs#L100 It is normal for `pwrite()` to return a non-zero value (number of bytes written) but `mkerr_libc()` always turns it into an `Err`.