- process-wait #!optional PROCESS NOHANGprocedure
Suspends the current process until the child process identifier by PROCESS, which should be a process object or an integer process id (pid), has terminated using the UNIX system call waitpid(). If PROCESS is not given, then this procedure waits for any child process. If NOHANG is given and not #f then the current process is not suspended. This procedure returns three values:
- PID or 0, if NOHANG is true and the child process has not terminated yet.
- #t if the process exited normally or #f otherwise.
- either the exit status, if the process terminated normally or the signal number that terminated/stopped the process.
Note that suspending the current process implies that all threads are suspended as well.
The exit status and the flag indicating whether the process returned normally are also stored in PROCESS, when given to be retrieved later, if desired.
On Windows, process-wait always returns #t for a terminated process and only the exit status is available. (Windows does not provide signals as an interprocess communication method.)