Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
Process.ppid
() -> ::Integer
Process.ppid → integer
process.c
View on GitHub ↗
static VALUE
proc_get_ppid(VALUE _)
{
return get_ppid();
}
Returns the process ID of the parent of the current process:
Example
puts "Pid is #{Process.pid}." fork { puts "Parent pid is #{Process.ppid}." }
Output:
Pid is 271290. Parent pid is 271290.
May not return a trustworthy value on certain platforms.