I am currently in an operating systems class and my teacher spent half of the class period talking about PIDs. She mentioned, as many know, that processes know their parent’s ID.
My question is this:
Does a process’s PCB know its child’s ID? If so, what is the way to go about it obtaining it?
As far as I know a process doesn’t have an explicit list of its children’s PIDs, but it can easily be built, since a process should know which child processes it spawns. For example the UNIX fork() call returns the child PID in the parent process and 0 in the child process, CreateProcess() on Windows returns (IIRC) the PID of the new process created.