Skip to content

Expose strerror and strerror_r #545

Open
@Susurrus

Description

@Susurrus

I'm refactoring some code of mine to use nix where possible but right now I can't get a string description for low-level errors. I used to use errno, but you can't do that easily with nix because once you have an Errno there's no way to get the underlying i32 and pass that to libc::strerror. Instead of supporting extracting this integer, it'd be useful having a safe wrapper around strerror. I'd be happy to do this since I already have code that does it, but I don't know where it should go or if this functionality is desired in nix. Should I add wrappers for strerror and strerror_r in a new /src/string.rs module?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions