#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

#6 in Operating systems

Download history 4898/week @ 2018-11-03 5437/week @ 2018-11-10 3923/week @ 2018-11-17 4671/week @ 2018-11-24 5228/week @ 2018-12-01 6541/week @ 2018-12-08 4960/week @ 2018-12-15 3176/week @ 2018-12-22 2656/week @ 2018-12-29 4803/week @ 2019-01-05 4623/week @ 2019-01-12 5540/week @ 2019-01-19 5767/week @ 2019-01-26 6276/week @ 2019-02-02 8598/week @ 2019-02-09

9,362 downloads per month
Used in 141 crates (67 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

~572KB