commit | f75ada727eb06514be8f5e1f1cc0b2a23a34d181 | [log] [tgz] |
---|---|---|
author | James Farrell <[email protected]> | Thu May 09 20:06:23 2024 +0000 |
committer | Automerger Merge Worker <[email protected]> | Thu May 09 20:06:23 2024 +0000 |
tree | 1dc1fd77a4c97fd70d83800e5777dc6096f30f53 | |
parent | 2b866f834d6baa5e24cc0836a8675451acab7c43 [diff] | |
parent | 3472a6c09455017e46454b8e82452d33e00dea9b [diff] |
Update Android.bp by running cargo_embargo am: 3472a6c094 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/errno/+/3079678 Change-Id: I8454263ea966bef323a44e9a777f0fff99e57055 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::Error
The 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.