| commit | 5061bf968a7757722e0ed692c5a0db5532e5649c | [log] [tgz] |
|---|---|---|
| author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Aug 01 23:13:04 2025 -0700 |
| committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Aug 01 23:13:04 2025 -0700 |
| tree | d71f1188d7446cc0ecb1f8f2aa97926c66761ce0 | |
| parent | 07b31294e4234701bb75ab6d71d8eaa589ad935e [diff] | |
| parent | 887a4f21c89039b4492b65f9ef66cac744cec8a4 [diff] |
Snap for 13873778 from 887a4f21c89039b4492b65f9ef66cac744cec8a4 to internal-android15-automotiveos-lts-release Change-Id: If9ee2e7d3546b7f3cae012970b845c5883da379f
Cross-platform interface to the errno variable. Works on Rust 1.56 or newer.
Documentation is available at https://docs.rs/errno.
Add to your Cargo.toml:
[dependencies] errno = "*"
std::io::ErrorThe standard library provides Error::last_os_error which fetches errno in the same way.
This crate provides these extra features:
#![no_std] supportset_errno functionextern 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);
#![no_std]Enable #![no_std] support by disabling the default std feature:
[dependencies] errno = { version = "*", default-features = false }
The Error impl will be unavailable.