#errno #no-std #unix #linux #windows

no-std errno-no-std

Cross-platform interface to the errno variable

12 releases

0.2.1 Feb 19, 2024
0.2.0 Oct 24, 2023
0.1.5 Jun 27, 2022
0.1.0 May 24, 2022
0.0.1 Oct 2, 2021

#180 in Operating systems

Download history 1/week @ 2024-01-01 162/week @ 2024-02-19 29/week @ 2024-02-26 26/week @ 2024-03-04 23/week @ 2024-03-11 55/week @ 2024-03-18 67/week @ 2024-03-25 118/week @ 2024-04-01 83/week @ 2024-04-08 77/week @ 2024-04-15

354 downloads per month
Used in 6 crates (3 directly)

MIT/Apache

16KB
362 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);

lib.rs:

Crate features

  • "std" Enabled by default. Disable to make the library #![no_std].

Dependencies

~0–315KB