waitpid2

Process.waitpid2(pid=-1, flags=0) รข [pid, status]
Class Public methods

Waits for a child process to exit (see ::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 SystemCallError if there are no child processes.

Process.fork { exit 99 }   #=> 27437
pid, status = Process.wait2
pid                        #=> 27437
status.exitstatus          #=> 99
doc_ruby_on_rails
2015-04-28 23:35:43
Comments
Leave a Comment

Please login to continue.