Method: Process#ppid

Defined in:
process.c

#ppidInteger (private)

Returns the process ID of the parent of the current process:

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.

Returns:



558
559
560
561
562
# File 'process.c', line 558

static VALUE
proc_get_ppid(VALUE _)
{
    return get_ppid();
}