Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
src/ | H | 03-May-2022 | - | 324 | 205 | |
.cargo-checksum.json | H A D | 03-May-2022 | 89 | 1 | 1 | |
.cargo_vcs_info.json | H A D | 18-Jul-2020 | 74 | 6 | 5 | |
.gitignore | H A D | 16-Nov-2015 | 18 | 3 | 2 | |
.travis.yml | H A D | 27-Mar-2020 | 569 | 26 | 25 | |
Cargo.toml | H A D | 18-Jul-2020 | 1.2 KiB | 33 | 31 | |
Cargo.toml.orig-cargo | H A D | 18-Jul-2020 | 688 | 27 | 19 | |
LICENSE-APACHE | H A D | 18-Feb-2018 | 10.6 KiB | 202 | 169 | |
LICENSE-MIT | H A D | 18-Feb-2018 | 1 KiB | 26 | 22 | |
README.md | H A D | 27-Mar-2020 | 821 | 39 | 24 |
README.md
1# errno [![Build status](https://img.shields.io/travis/lambda-fairy/rust-errno.svg)](http://travis-ci.org/lambda-fairy/rust-errno) [![Cargo](https://img.shields.io/crates/v/errno.svg)](https://crates.io/crates/errno) 2 3Cross-platform interface to the [`errno`][errno] variable. Works on Rust 1.13 or newer. 4 5Documentation is available at <https://docs.rs/errno>. 6 7[errno]: https://en.wikipedia.org/wiki/Errno.h 8 9 10## Dependency 11 12Add to your `Cargo.toml`: 13 14```toml 15[dependencies] 16errno = "*" 17libc = "*" 18``` 19 20 21## Examples 22 23```rust 24extern crate errno; 25use errno::{Errno, errno, set_errno}; 26 27// Get the current value of errno 28let e = errno(); 29 30// Set the current value of errno 31set_errno(e); 32 33// Extract the error code as an i32 34let code = e.0; 35 36// Display a human-friendly error message 37println!("Error {}: {}", code, e); 38``` 39