#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

#1 in Operating systems

Download history 2056/week @ 2018-07-02 2187/week @ 2018-07-09 2978/week @ 2018-07-16 2926/week @ 2018-07-23 2975/week @ 2018-07-30 3565/week @ 2018-08-06 4056/week @ 2018-08-13 3514/week @ 2018-08-20 3457/week @ 2018-08-27 3811/week @ 2018-09-03 4146/week @ 2018-09-10 4255/week @ 2018-09-17 4801/week @ 2018-09-24

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

~600KB