So I have this function that forks N number of child processes. However it seems to be forking more than specified. Can you tell me what I\'m doing wrong? Thanks
The fork() call spawns a new process which begins its execution at the exact same point where the fork occurred. So, it looks like fork "returns twice"
What's happening here is that your fork() call returns twice, so both the parent and child process continue looping and spawning new processes. Each child (of both the original parent and child) then forks again, repeatedly doubling the number of processes...