#errno

errno

Cross-platform interface to the errno variable

14 releases

0.2.4 Jul 10, 2018
0.2.3 Feb 17, 2017
0.2.1 Dec 6, 2016
0.2.0 Nov 20, 2016
0.1.1 Mar 29, 2015

#12 in Operating systems

Download history 16069/week @ 2019-10-04 15264/week @ 2019-10-11 20879/week @ 2019-10-18 19794/week @ 2019-10-25 19649/week @ 2019-11-01 19247/week @ 2019-11-08 19457/week @ 2019-11-15 17695/week @ 2019-11-22 15368/week @ 2019-11-29 18221/week @ 2019-12-06 19057/week @ 2019-12-13 11723/week @ 2019-12-20 9009/week @ 2019-12-27 16432/week @ 2020-01-03 21732/week @ 2020-01-10

75,888 downloads per month
Used in 247 crates (81 directly)

MIT/Apache

10KB
159 lines

errno Build status Build status Cargo

Cross-platform interface to the errno variable. Works on Rust 1.13 or newer.

Documentation is available at https://docs.rs/errno.

Dependency

Add to your Cargo.toml:

[dependencies]
errno = "*"
libc = "*"

Examples

extern crate errno;
use errno::{Errno, errno, set_errno};

// Get the current value of errno
let e = errno();

// Set the current value of errno
set_errno(e);

// Extract the error code as an i32
let code = e.0;

// Display a human-friendly error message
println!("Error {}: {}", code, e);

lib.rs:

Cross-platform interface to the errno variable.

Dependencies

~34KB