#errno #unix #windows

no-std errno-no-std

Cross-platform interface to the errno variable

13 releases

0.2.2 Sep 13, 2024
0.2.1 Feb 19, 2024
0.2.0 Oct 24, 2023
0.1.5 Jun 27, 2022
0.0.1 Oct 2, 2021

#216 in No standard library

Download history 3/week @ 2025-05-28 73/week @ 2025-06-04 67/week @ 2025-06-11 54/week @ 2025-06-18 42/week @ 2025-06-25 47/week @ 2025-07-02 48/week @ 2025-07-09 33/week @ 2025-07-16 27/week @ 2025-07-23 43/week @ 2025-07-30 23/week @ 2025-08-06 2/week @ 2025-08-13 31/week @ 2025-08-20 30/week @ 2025-08-27 57/week @ 2025-09-03 34/week @ 2025-09-10

152 downloads per month
Used in 10 crates (3 directly)

MIT/Apache

17KB
363 lines

maintenance: actively developed

errno-no-std

Cross-platform interface to the errno variable.

An improved version of the errno crate.

Examples

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);

Dependencies

~180–510KB