Processes

Zombie processes

// create one child process

pid = fork();
if(pid == 0) {
	 // do some stuff
	 exit(0);
}
// do some other stuff
wait(0);

// create multiple child process

for(i=0; i<3; i++) {
	 pid = fork();
	 if(pid == 0) {
		 // do some stuff
		 exit(0);
	 }
}
// do some other stuff
for(i=0; i<3; i++) {
	 wait(0);
}

<unistd.h>

fork()