Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Process::Status#pid
() -> ::Integer
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 of the process:
Example
system("false") $?.pid # => 1247002