When calling fork()
the PID of the parent is saved in the child's PCB. In which case would it be useful for the child to know its parent's PID?
A process may wish to know if it was started by the init
process at system startup, for example, and modify its behaviour accordingly.
Or, it may wish to communicate with its parent, say, to indicate something is complete, by sending a signal.