1 use crate::io as std_io;
4 pub use core::slice::memchr::{memchr, memrchr};
7 pub use crate::sys_common::os_str_bytes as os_str;
9 // This is not necessarily correct. May want to consider making it part of the
11 use crate::os::raw::c_char;
13 // SAFETY: must be called only once during runtime initialization.
14 // NOTE: this is not guaranteed to run, for example when Rust code is called externally.
15 pub unsafe fn init(_argc: isize, _argv: *const *const u8) {}
17 // SAFETY: must be called only once during runtime cleanup.
18 // NOTE: this is not guaranteed to run, for example when the program aborts.
19 pub unsafe fn cleanup() {}
21 pub fn unsupported<T>() -> std_io::Result<T> {
22 Err(unsupported_err())
25 pub fn unsupported_err() -> std_io::Error {
26 std_io::Error::new_const(
27 std_io::ErrorKind::Unsupported,
28 &"operation not supported on this platform",
32 pub fn decode_error_kind(_code: i32) -> crate::io::ErrorKind {
33 crate::io::ErrorKind::Uncategorized
36 pub fn abort_internal() -> ! {
37 core::intrinsics::abort();
40 pub fn hashmap_random_keys() -> (u64, u64) {
44 pub unsafe fn strlen(mut s: *const c_char) -> usize {
45 // SAFETY: The caller must guarantee `s` points to a valid 0-terminated string.