#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

#7 in Operating systems

Download history 9649/week @ 2019-07-01 11147/week @ 2019-07-08 12839/week @ 2019-07-15 11364/week @ 2019-07-22 11924/week @ 2019-07-29 14000/week @ 2019-08-05 14344/week @ 2019-08-12 12177/week @ 2019-08-19 12094/week @ 2019-08-26 11740/week @ 2019-09-02 15933/week @ 2019-09-09 16916/week @ 2019-09-16 13795/week @ 2019-09-23 14196/week @ 2019-09-30 14415/week @ 2019-10-07

103,554 downloads per month
Used in 223 crates (78 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

~33KB