--- !ruby/object:RI::MethodDescription
aliases: []
block_params:
comment:
- !ruby/struct:SM::Flow::P
body: "Waits for a child process to exit, returns its process id, and sets $? to a Process::Status object containing information on that process. Which child it waits on depends on the value of pid:"
- !ruby/object:SM::Flow::LIST
contents:
- !ruby/struct:SM::Flow::LI
label: "> 0:"
body: Waits for the child whose process ID equals pid.
- !ruby/struct:SM::Flow::LI
label: "0:"
body: Waits for any child whose process group ID equals that of the calling process.
- !ruby/struct:SM::Flow::LI
label: "-1:"
body: Waits for any child process (the default if no pid is given).
- !ruby/struct:SM::Flow::LI
label: "< -1:"
body: Waits for any child whose process group ID equals the absolute value of pid.
type: :NOTE
- !ruby/struct:SM::Flow::P
body: The flags argument may be a logical or of the flag values Process::WNOHANG (do not block if no child available) or Process::WUNTRACED (return stopped children that haven't been reported). Not all flags are available on all platforms, but a flag value of zero will work on all platforms.
- !ruby/struct:SM::Flow::P
body: Calling this method raises a SystemError if there are no child processes. Not available on all platforms.
- !ruby/struct:SM::Flow::VERB
body: " include Process\n fork { exit 99 } #=> 27429\n wait #=> 27429\n $?.exitstatus #=> 99\n\n pid = fork { sleep 3 } #=> 27440\n Time.now #=> Wed Apr 09 08:57:09 CDT 2003\n waitpid(pid, Process::WNOHANG) #=> nil\n Time.now #=> Wed Apr 09 08:57:09 CDT 2003\n waitpid(pid, 0) #=> 27440\n Time.now #=> Wed Apr 09 08:57:12 CDT 2003\n"
full_name: Process::wait
is_singleton: true
name: wait
params: |
Process.wait() => fixnum
Process.wait(pid=-1, flags=0) => fixnum
Process.waitpid(pid=-1, flags=0) => fixnum
visibility: public