I'm trying to make a program that will spawn multiple child processes then exit. I'm having trouble figuring out how to do this since after I fork, the child process begins running the program again (never ending).
int main(void){
for(int i = 0; i < 3; i++){
fork();
}
exit(0);
}
Could someone explain how I may be able to do this correctly? And yes, I do want them to be orphaned (on purpose).