Fork: PIDs and PPIDs (11.10)
If fork() succeeds, it returns the child PID to the parent and returns 0 to the child; if it fails, it returns -1 to the parent (no child is created)
System call: int getpid()
getpid() returns the PID of the current process, and getppid() returns the PID of the parent process (note: ppid of 1 is 1)
example (see next slide …)