diff options
| author | Ian Chamberlain <ian.h.chamberlain@gmail.com> | 2022-02-09 23:54:38 -0500 |
|---|---|---|
| committer | Mark Drobnak <mark.drobnak@gmail.com> | 2022-06-13 20:44:57 -0700 |
| commit | 19f68a272912beaa68cb6c172e16ee6f21e96bf8 (patch) | |
| tree | 3b22aa8e7fba5a5b26c45f7eb1a9dfd1a87ff794 /library/std/src/sys/unix/mod.rs | |
| parent | 06eae300347447545f5d0e8e94c673da69a1d7fd (diff) | |
| download | rust-19f68a272912beaa68cb6c172e16ee6f21e96bf8.tar.gz rust-19f68a272912beaa68cb6c172e16ee6f21e96bf8.zip | |
Enable argv support for horizon OS
See https://github.com/Meziu/rust-horizon/pull/9
Diffstat (limited to 'library/std/src/sys/unix/mod.rs')
| -rw-r--r-- | library/std/src/sys/unix/mod.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/library/std/src/sys/unix/mod.rs b/library/std/src/sys/unix/mod.rs index 000eaff6a02..34a023b02c4 100644 --- a/library/std/src/sys/unix/mod.rs +++ b/library/std/src/sys/unix/mod.rs @@ -43,10 +43,10 @@ pub mod thread_local_key; pub mod thread_parker; pub mod time; -#[cfg(any(target_os = "espidf", target_os = "horizon"))] +#[cfg(target_os = "espidf")] pub fn init(argc: isize, argv: *const *const u8) {} -#[cfg(not(any(target_os = "espidf", target_os = "horizon")))] +#[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) { @@ -88,6 +88,7 @@ pub unsafe fn init(argc: isize, argv: *const *const u8) { target_os = "ios", target_os = "redox", target_os = "l4re", + target_os = "horizon", )))] 'poll: { use crate::sys::os::errno; @@ -131,6 +132,7 @@ pub unsafe fn init(argc: isize, argv: *const *const u8) { target_os = "fuchsia", target_os = "vxworks", target_os = "l4re", + target_os = "horizon", )))] { use crate::sys::os::errno; @@ -149,7 +151,7 @@ pub unsafe fn init(argc: isize, argv: *const *const u8) { } unsafe fn reset_sigpipe() { - #[cfg(not(any(target_os = "emscripten", target_os = "fuchsia")))] + #[cfg(not(any(target_os = "emscripten", target_os = "fuchsia", target_os = "horizon")))] rtassert!(signal(libc::SIGPIPE, libc::SIG_IGN) != libc::SIG_ERR); } } |
