1 //! Implementation of `errno` functionality for RustyHermit.
2 //!
3 //! Currently, the error handling in RustyHermit isn't clearly
4 //! defined. At the current stage of RustyHermit, only a placeholder
5 //! is provided to be compatible to the classical errno interface.
6
7 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
8 // file at the top-level directory of this distribution and at
9 // http://rust-lang.org/COPYRIGHT.
10 //
11 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
12 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
13 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
14 // option. This file may not be copied, modified, or distributed
15 // except according to those terms.
16
17 use crate::Errno;
18
with_description<F, T>(_err: Errno, callback: F) -> T where F: FnOnce(Result<&str, Errno>) -> T,19 pub fn with_description<F, T>(_err: Errno, callback: F) -> T
20 where
21 F: FnOnce(Result<&str, Errno>) -> T,
22 {
23 callback(Ok("unknown error"))
24 }
25
26 pub const STRERROR_NAME: &str = "strerror_r";
27
errno() -> Errno28 pub fn errno() -> Errno {
29 Errno(0)
30 }
31
set_errno(_: Errno)32 pub fn set_errno(_: Errno) {}
33