Method: Process#ppid

Defined in:
process.c

#ppidFixnum (private)

Returns the process id of the parent of this process. Returns untrustworthy value on Win32/64. Not available on all platforms.

puts "I am #{Process.pid}"
Process.fork { puts "Dad is #{Process.ppid}" }

produces:

I am 27417
Dad is 27417

Returns:



241
242
243
244
245
246
# File 'process.c', line 241

static VALUE
get_ppid(void)
{
    rb_secure(2);
    return PIDT2NUM(getppid());
}