Bind Trap::i32_exit_status in C API (#1912)

This allows embedders to take a different action when a WASI program
exits depending on whether it exited with an exit status or exited with
a trap.

cc bytecodealliance/wasmtime-py#30
This commit is contained in:
Alex Crichton
2020-06-23 11:40:51 -05:00
committed by GitHub
parent 60ac091afe
commit 6f6296816b
2 changed files with 21 additions and 0 deletions

View File

@@ -167,6 +167,15 @@ WASM_API_EXTERN own wasmtime_interrupt_handle_t *wasmtime_interrupt_handle_new(w
WASM_API_EXTERN void wasmtime_interrupt_handle_interrupt(wasmtime_interrupt_handle_t *handle);
///////////////////////////////////////////////////////////////////////////////
//
// Extensions to `wasm_trap_t`
// Returns `true` if the trap is a WASI "exit" trap and has a return status. If
// `true` is returned then the exit status is returned through the `status`
// pointer. If `false` is returned then this is not a wasi exit trap.
WASM_API_EXTERN bool wasmtime_trap_exit_status(const wasm_trap_t*, int *status);
///////////////////////////////////////////////////////////////////////////////
//
// Extensions to `wasm_frame_t`