#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

#4 in Operating systems

Download history 3531/week @ 2018-12-20 2485/week @ 2018-12-27 4759/week @ 2019-01-03 4199/week @ 2019-01-10 5482/week @ 2019-01-17 5548/week @ 2019-01-24 5754/week @ 2019-01-31 7656/week @ 2019-02-07 9777/week @ 2019-02-14 10919/week @ 2019-02-21 11679/week @ 2019-02-28 8624/week @ 2019-03-07 10597/week @ 2019-03-14 9468/week @ 2019-03-21 12076/week @ 2019-03-28

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

~581KB