End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Process::Status#pid
stat.pid → integer
process.c
View on GitHub ↗
static VALUE
pst_pid_m(VALUE self)
{
rb_pid_t pid = pst_pid(self);
return PIDT2NUM(pid);
}
Returns the process ID that this status object represents.
Example
fork { exit } #=> 26569 Process.wait #=> 26569 $?.pid #=> 26569