#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

#2 in Operating systems

Download history 3175/week @ 2018-09-05 3953/week @ 2018-09-12 5098/week @ 2018-09-19 4470/week @ 2018-09-26 4199/week @ 2018-10-03 4488/week @ 2018-10-10 5095/week @ 2018-10-17 4975/week @ 2018-10-24 5070/week @ 2018-10-31 4686/week @ 2018-11-07 5419/week @ 2018-11-14 4727/week @ 2018-11-21 3759/week @ 2018-11-28

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

~587KB