text: Exercise 5
  Try to figure out what is the output of the following program:
  #include
  int main (int argc, char ** argv){
  int i = 0;
  printf ("%d %d\n", getpid(), ++i);
  execl (argv[0], argv[0], 0);
  printf ("end\n");
  return (1);
  }
  Then compile and run it and see what's going on
  ahmad el zein's Profile
  Exercise 5
  Operating Systems
  Laboratory 5
  Learning goals: in this laboratory activity you will learn how to use waitpid and exec system
  calls. You will understand how to wait for a specific child and how to excute command in your
  own programs.
  Exercise 1
  Using system calls fork and waitpid write a program that receive a number n from the command
  line and do the following:
  1. creates n processes
  2. the first child created sleep n second, the second child sleep n-1 seconds and so on.....(the
  last child sleep 1 second)
  3. the parent wait for “all” the child(it waits sequentially starting from the first created to the
  last – you have to use waitpid system call)
  -----------------------------------------------------------------------------------------------------------------------
  -----------------------------------------------------------------------------------------------------------------------
  Exercise 2
  Modify the exercise 1 using wait instead waitpid . How many times the parent has to call “wait” ?
  Does this program behaves as the previous one? Check it out!
  ------------------------------------------------------------------------------------------------------------------------
  ------------------------------------------------------------------------------------------------------------------------
  Exercise 3
  Run, in background mode, the programs you wrote in the exercises 1 and 2 and using ps command
  try to figure out how many zombie process you have.