Skip to content

Commit

Permalink
add unstable exit-with-code function
Browse files Browse the repository at this point in the history
Whereas the existing `exit` function only accepts a `result` parameter
(i.e. binary success or failure), this function allows the instance to report
any status code from 0 to 255 to the host, with 0 usually meaning "success" and
other values having their own meaning depending on the context.

Fixes WebAssembly#11

Signed-off-by: Joel Dice <joel.dice@fermyon.com>
  • Loading branch information
dicej committed Jul 11, 2024
1 parent 6ae8261 commit 7e705fd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions wit/exit.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
interface exit {
/// Exit the current instance and any linked instances.
exit: func(status: result);

/// Exit the current instance and any linked instances, reporting the
/// specified status code to the host.
@unstable(feature = exit-with-code)
exit-with-code: func(status-code: u8);
}

0 comments on commit 7e705fd

Please sign in to comment.