add __exit

This commit is contained in:
Mackenzie Clark 2019-03-01 11:24:14 -08:00
parent 00e3ec1446
commit 65100d19fc
2 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,7 @@
use wasmer_runtime_core::vm::Ctx;
// __exit
pub fn __exit(_ctx: &mut Ctx, value: i32) {
debug!("emscripten::__exit {}", value);
::std::process::exit(value);
}

View File

@ -32,6 +32,7 @@ mod env;
mod errno;
mod exception;
mod exec;
mod exit;
mod io;
mod jmp;
mod linking;
@ -443,6 +444,9 @@ pub fn generate_emscripten_env(globals: &mut EmscriptenGlobals) -> ImportObject
// exec
"_execvp" => func!(crate::exec::_execvp),
// exit
"__exit" => func!(crate::exit::__exit),
// Env
"___assert_fail" => func!(crate::env::___assert_fail),
"_getenv" => func!(crate::env::_getenv),