Advertisement
Guest User

c

a guest
Sep 29th, 2022
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. char path_1[100] = "/usr/bin/";
  2. strcat(path_1, name_of_program_1);
  3. char path_2[100] = "/usr/bin/";
  4. strcat(path_2, name_of_program_2);
  5.  
  6. int pid_1 = fork();
  7. if (pid_1 == 0)
  8. {
  9. int check = execv(path_1 , argv_for_program);
  10. printf("%d\n",check);
  11. }
  12. wait(0);
  13.  
  14. /*
  15. int pid_2 = fork();
  16. if (pid_2 == 0)
  17. {
  18. int check = execv(path_2 , argv_for_program);
  19. printf("%d\n",check);
  20. }
  21. wait(0);
  22. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement