Guest User

Untitled

a guest
Jul 21st, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.32 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <signal.h>
  4. #include <unistd.h>
  5. #include <sys/types.h>
  6. #include <sys/errno.h>
  7.  
  8. int main()
  9. {
  10.     int x;
  11.     for(x; x<3; x++)
  12.     {
  13.         switch (fork())
  14.         {
  15.             case -1:
  16.                 perror("fork error");
  17.                 exit(1);
  18.             case 0:
  19.                 execl("prog1.x", "prog1.x", NULL);
  20.         }
  21.     }
  22.     return 0;
  23. }
Add Comment
Please, Sign In to add comment