/* Includes */ #include /* Symbolic Constants */ //#include /* Primitive System Data Types */ //#include /* Errors */ #include /* Input/Output */ //#include /* Wait for Process Termination */ #include /* General Utilities */ #define MAXLINE 80 int main() { pid_t childpid; int i; for (i = 0; i < 5; i++) { childpid = fork(); if (childpid) { printf("Creating child with ID %i\n", childpid); } else { printf("Child %i going to sleep\n", getpid()); sleep(3); printf("Child %i woke up and quit\n", getpid()); exit(0); } } sleep(5); exit(0); }