Process.pid and Process.ppid
proc1 = Process.pid fork do if Process.ppid == proc1 puts "proc1 is my parent" # Prints this message else puts "What's going on?" end end