API Reference › Process › Process.kill
method

Process.kill

Process.kill(handle) -> void

Ends the child at once — SIGKILL on macOS, TerminateProcess on Windows — with no chance for it to save anything. A later Process.poll answers 137 once it has gone. Does nothing for a child that has already ended, or a handle that is not one.

Example

program Demo {
  entry {
    let h = Process.spawn("/bin/sleep", ["30"])
    Process.kill(h)
  }
}
← All symbols