Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <process.h>
  4. #include <sys/resource.h>
  5. int main(int argc, char **argv, char **env)
  6. {
  7. pid_t pid;
  8. pid = vfork();
  9. if (pid == 0)
  10. {
  11. execlp("./process", "process", NULL);
  12. perror("Child");
  13. exit(EXIT_FAILURE);
  14. }
  15. waitpid(0, NULL, 0);
  16. printf("Parent PID = %d\n", getpid());
  17. printf("Parent PPID = %d\n", getppid());
  18. return EXIT_SUCCESS;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement