Skip to content

Fuchsia ErrorKind not translated from Zircon error value #102077

Open
@andrewpollack

Description

@andrewpollack

Relevant compiler test: https://github.com/rust-lang/rust/blob/master/src/test/ui/process/process-spawn-nonexistent.rs#L14

use std::io::ErrorKind;
use std::process::Command;

fn main() {
    let result = Command::new("nonexistent").spawn().unwrap_err().kind();

    assert!(matches!(
        result,
        ErrorKind::NotFound | ErrorKind::PermissionDenied
    ));
}

The resulting value for result is -25, which aligns with the Zircon error ZX_ERR_NOT_FOUND = -25. This does not align with expected Rust-friendly return value.

Relevant code section is at

pub fn zx_cvt<T>(t: T) -> io::Result<T>

cc. @tmandry

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.O-fuchsiaOperating system: FuchsiaT-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions