Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upExpose strerror and strerror_r #545
Comments
Susurrus
changed the title
Expose strerror and friends
Expose strerror and strerror_r
Mar 1, 2017
This comment has been minimized.
This comment has been minimized.
|
You want a function |
This comment has been minimized.
This comment has been minimized.
|
So it looks like this behavior already exists in |
This comment has been minimized.
This comment has been minimized.
You can do this via a cast: |
This comment has been minimized.
This comment has been minimized.
|
I don't need this functionality anymore since discovering |
This comment has been minimized.
This comment has been minimized.
|
We can convert it to a doc issue :-) |
This comment has been minimized.
This comment has been minimized.
|
If you have a suggestion for how to document this, I can submit a PR for it. I just don't know where this should go. |
This comment has been minimized.
This comment has been minimized.
|
@Susurrus maybe module level docs on |
This comment has been minimized.
This comment has been minimized.
|
Re #545 (comment) would it be accepted to add Also, do you mean I should add docs to |
This comment has been minimized.
This comment has been minimized.
|
Regarding this, is there any reason to have hard-coded error strings in nix versus uses |
Susurrus commentedMar 1, 2017
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 withnixbecause once you have anErrnothere's no way to get the underlyingi32and pass that tolibc::strerror. Instead of supporting extracting this integer, it'd be useful having a safe wrapper aroundstrerror. 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 innix. Should I add wrappers forstrerrorandstrerror_rin a new/src/string.rsmodule?