Signature: awaitProcess(handle: int) -> int

Description: Waits for a spawned process to complete and returns its exit code. Blocks until the process finishes.

Parameters #

  • handle (int): Process ID from spawnProcess

Returns: int

Example #

let exitCode = awaitProcess(processHandle)
print("Process exited with code: ${toString(exitCode)}")