diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2019-07-23 07:25:34 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2019-08-28 08:34:31 -0700 |
| commit | 8fe65da935d7e01dbac897dcfbb4fb0f9f24e442 (patch) | |
| tree | b254c7ebfb19010383348d31d31b83e85445d644 /src/libstd/sys/wasm/os.rs | |
| parent | ac21131f7859836cd3fcb39231c0162fd892d960 (diff) | |
| download | rust-8fe65da935d7e01dbac897dcfbb4fb0f9f24e442.tar.gz rust-8fe65da935d7e01dbac897dcfbb4fb0f9f24e442.zip | |
std: Remove the `wasm_syscall` feature
This commit removes the `wasm_syscall` feature from the wasm32-unknown-unknown build of the standard library. This feature was originally intended to allow an opt-in way to interact with the operating system in a posix-like way but it was never stabilized. Nowadays with the advent of the `wasm32-wasi` target that should entirely replace the intentions of the `wasm_syscall` feature.
Diffstat (limited to 'src/libstd/sys/wasm/os.rs')
| -rw-r--r-- | src/libstd/sys/wasm/os.rs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/libstd/sys/wasm/os.rs b/src/libstd/sys/wasm/os.rs index 5d21999a991..890049e8bfa 100644 --- a/src/libstd/sys/wasm/os.rs +++ b/src/libstd/sys/wasm/os.rs @@ -4,7 +4,7 @@ use crate::fmt; use crate::io; use crate::path::{self, PathBuf}; use crate::str; -use crate::sys::{unsupported, Void, ExitSysCall, GetEnvSysCall, SetEnvSysCall}; +use crate::sys::{unsupported, Void}; pub fn errno() -> i32 { 0 @@ -73,16 +73,16 @@ pub fn env() -> Env { panic!("not supported on web assembly") } -pub fn getenv(k: &OsStr) -> io::Result<Option<OsString>> { - Ok(GetEnvSysCall::perform(k)) +pub fn getenv(_: &OsStr) -> io::Result<Option<OsString>> { + Ok(None) } -pub fn setenv(k: &OsStr, v: &OsStr) -> io::Result<()> { - Ok(SetEnvSysCall::perform(k, Some(v))) +pub fn setenv(_: &OsStr, _: &OsStr) -> io::Result<()> { + Err(io::Error::new(io::ErrorKind::Other, "cannot set env vars on wasm32-unknown-unknown")) } -pub fn unsetenv(k: &OsStr) -> io::Result<()> { - Ok(SetEnvSysCall::perform(k, None)) +pub fn unsetenv(_: &OsStr) -> io::Result<()> { + Err(io::Error::new(io::ErrorKind::Other, "cannot unset env vars on wasm32-unknown-unknown")) } pub fn temp_dir() -> PathBuf { @@ -94,7 +94,9 @@ pub fn home_dir() -> Option<PathBuf> { } pub fn exit(_code: i32) -> ! { - ExitSysCall::perform(_code as isize as usize) + unsafe { + crate::arch::wasm32::unreachable(); + } } pub fn getpid() -> u32 { |
