| commit | 6589ed70ccd8e7ce1bc4f756aecb4b59fcc2936e | [log] [tgz] |
|---|---|---|
| author | James Farrell <[email protected]> | Thu May 09 20:27:28 2024 +0000 |
| committer | Automerger Merge Worker <[email protected]> | Thu May 09 20:27:28 2024 +0000 |
| tree | 1dc1fd77a4c97fd70d83800e5777dc6096f30f53 | |
| parent | 0d4753f60ee3e1d1fa0990b9ab1d75cffd54f5a4 [diff] | |
| parent | f75ada727eb06514be8f5e1f1cc0b2a23a34d181 [diff] |
Update Android.bp by running cargo_embargo am: 3472a6c094 am: f75ada727e Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/errno/+/3079678 Change-Id: Iaafa85d077e3042841dea278addc1434448567f8 Signed-off-by: Automerger Merge Worker <[email protected]>
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.