std/sys/pal/unsupported/
common.rs

1use crate::io as std_io;
2
3// SAFETY: must be called only once during runtime initialization.
4// NOTE: this is not guaranteed to run, for example when Rust code is called externally.
5pub unsafe fn init(_argc: isize, _argv: *const *const u8, _sigpipe: u8) {}
6
7// SAFETY: must be called only once during runtime cleanup.
8// NOTE: this is not guaranteed to run, for example when the program aborts.
9pub unsafe fn cleanup() {}
10
11pub fn unsupported<T>() -> std_io::Result<T> {
12    Err(unsupported_err())
13}
14
15pub fn unsupported_err() -> std_io::Error {
16    std_io::Error::UNSUPPORTED_PLATFORM
17}
18
19pub fn is_interrupted(_code: i32) -> bool {
20    false
21}
22
23pub fn decode_error_kind(_code: i32) -> crate::io::ErrorKind {
24    crate::io::ErrorKind::Uncategorized
25}
26
27pub fn abort_internal() -> ! {
28    core::intrinsics::abort();
29}