#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

#398 in No standard library

Download history 33/week @ 2025-10-28 15/week @ 2025-11-04 22/week @ 2025-11-11 20/week @ 2025-11-18 22/week @ 2025-11-25 213/week @ 2025-12-02 197/week @ 2025-12-09 196/week @ 2025-12-16 191/week @ 2025-12-23 182/week @ 2025-12-30 175/week @ 2026-01-06 191/week @ 2026-01-13 196/week @ 2026-01-20 197/week @ 2026-01-27 200/week @ 2026-02-03 88/week @ 2026-02-10

714 downloads per month
Used in 11 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

~175–510KB