A call on “exec” is frequently preceded by a call on “fork”. Most of the work for “fork” is done by “newproc” (1826), but before the latter is called, “fork” makes an independent search for a slot in the “proc” array, and remembers the place as “p2” (3327).
“newproc” also searches “proc” but independently. Presumably it always locates the same empty slot as “fork”, since it does not report the value back. (Why is there no confusion on this point?)
For the new process, “fork” returns the value of the parent’s process identification, and initialises various accounting parameters;
For the parent process, “fork” returns the value of the child’s process identification, and skips the user mode program counter by one word.
Note that the values finally returned to a “C” program are slightly different from the above. Refer to the section FORK(II) of the UPM.