diff options
| author | ivmarkov <ivan.markov@gmail.com> | 2021-07-29 20:18:22 +0300 |
|---|---|---|
| committer | ivmarkov <imarkov@vmware.com> | 2021-08-10 12:09:00 +0300 |
| commit | 459eaa6baea4127b37769d0b7944fa00c175e770 (patch) | |
| tree | 100c65b39f217096a01f3c0f256a672bfeaacd42 /library/std/src/sys/unix/mod.rs | |
| parent | ae90dcf0207c57c3034f00b07048d63f8b2363c8 (diff) | |
| download | rust-459eaa6baea4127b37769d0b7944fa00c175e770.tar.gz rust-459eaa6baea4127b37769d0b7944fa00c175e770.zip | |
STD support for the ESP-IDF framework
Diffstat (limited to 'library/std/src/sys/unix/mod.rs')
| -rw-r--r-- | library/std/src/sys/unix/mod.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/library/std/src/sys/unix/mod.rs b/library/std/src/sys/unix/mod.rs index f827a4bca53..f5424e3d282 100644 --- a/library/std/src/sys/unix/mod.rs +++ b/library/std/src/sys/unix/mod.rs @@ -5,6 +5,7 @@ use crate::io::ErrorKind; pub use self::rand::hashmap_random_keys; pub use libc::strlen; +#[cfg(not(target_os = "espidf"))] #[macro_use] pub mod weak; @@ -43,6 +44,10 @@ pub mod thread_local_dtor; pub mod thread_local_key; pub mod time; +#[cfg(target_os = "espidf")] +pub fn init(argc: isize, argv: *const *const u8) {} + +#[cfg(not(target_os = "espidf"))] // SAFETY: must be called only once during runtime initialization. // NOTE: this is not guaranteed to run, for example when Rust code is called externally. pub unsafe fn init(argc: isize, argv: *const *const u8) { @@ -304,3 +309,19 @@ cfg_if::cfg_if! { extern "C" {} } } + +#[cfg(target_os = "espidf")] +mod unsupported { + use crate::io; + + pub fn unsupported<T>() -> io::Result<T> { + Err(unsupported_err()) + } + + pub fn unsupported_err() -> io::Error { + io::Error::new_const( + io::ErrorKind::Unsupported, + &"operation not supported on this platform", + ) + } +} |
