#include //pid_t #include //fork() #include //waitpid #include //printf... #include //exit() //gp-4.c int main(int argc, char *argv[]){ pid_t cpid, w, pid1,pid2,pid3,pid4,pid5,pid6,pid7; if (pid1=fork() == 0) execlp("/home/mumolo/proc","proc","T1",NULL); waitpid(pid1, NULL, 0); if (pid3=fork() == 0) execlp("/home/mumolo/proc","proc","T3",NULL); if (pid2=fork() == 0) execlp("/home/mumolo/proc","proc","T2",NULL); waitpid(pid2, NULL, 0); if (pid4=fork() == 0) execlp("/home/mumolo/proc","proc","T4",NULL); if (pid5=fork() == 0) execlp("/home/mumolo/proc","proc","T5",NULL); waitpid(pid3, NULL, 0); if (pid6=fork() == 0) execlp("/home/mumolo/proc","proc","T6",NULL); waitpid(pid5, NULL, 0); waitpid(pid4, NULL, 0); waitpid(pid6, NULL, 0); if (pid7=fork() == 0) execlp("/home/mumolo/proc","proc","T7",NULL); waitpid(pid7, NULL, 0); }