Function force_exit

Source
pub fn force_exit(status: c_int)
Expand description

Exits the program and kills the runtime, using emscripten_force_exit. Like libc’s exit, but works even if exit_with_live_runtime was run.

Only works if the project is built with EXIT_RUNTIME set - this is not the default. Build with -sEXIT_RUNTIME if you want to use this function.

§Arguments

  • status - the exit status, the same as for libc’s exit.

§Examples

force_exit(0); // Exits with status 0.
force_exit(1); // Exits with status 1.
force_exit(101); // Exits with status 101.