commit | 9d4fa1023b518e06ee94c186f9126af2dfa2cb53 | [log] [tgz] |
---|---|---|
author | James Farrell <jamesfarrell@google.com> | Tue May 21 15:04:21 2024 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue May 21 15:04:21 2024 +0000 |
tree | 7c40ec04e30cf0c5ff9e02a5392b0bc24d2f1d2f | |
parent | 6589ed70ccd8e7ce1bc4f756aecb4b59fcc2936e [diff] | |
parent | fff56144f0ea9a8161d00d111ac6c809889cccf1 [diff] |
Update Android.bp by running cargo_embargo am: 6c29b00dd9 am: fff56144f0 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/errno/+/3095560 Change-Id: I4bff27e3e98d9027b8cd6ced4be37cfc940c6423 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
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.