Advertisement
Guest User

launch

a guest
Sep 8th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. int launch(char **args)
  2. {
  3. pid_t pid, wpid;
  4.  
  5. /*Fork a childprocess */
  6. pid = fork();
  7.  
  8. if (pid<0)
  9. {
  10. /*Error during the Forking */
  11. fprintf(stderr, "Fork Failed!");
  12. }
  13. else if (pid== 0)
  14. {
  15. /*Child process */
  16. execvp(/*to be filled*/)
  17. }
  18. else
  19. {
  20. /*Parent process is waiting for the child to complete,
  21. we don't want orphans */
  22.  
  23.  
  24. wait(null);
  25. printf("Child complete")
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement