Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- #include <process.h>
- #include <sys/resource.h>
- int main(int argc, char **argv, char **env)
- {
- pid_t pid;
- pid = vfork();
- if (pid == 0)
- {
- execlp("./process", "process", NULL);
- perror("Child");
- exit(EXIT_FAILURE);
- }
- waitpid(0, NULL, 0);
- printf("Parent PID = %d\n", getpid());
- printf("Parent PPID = %d\n", getppid());
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement