method

waitpid2

v1_8_7_72 - Show latest stable - Class: Process
waitpid2(...)
public

Waits for a child process to exit (see Process::waitpid for exact semantics) and returns an array containing the process id and the exit status (a Process::Status object) of that child. Raises a SystemError if there are no child processes.

   Process.fork { exit 99 }   #=> 27437
   pid, status = Process.wait2
   pid                        #=> 27437
   status.exitstatus          #=> 99