Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sys/types. h>
- #include <stdio. h>
- #include <unistd. h>
- int value = 5;
- int main()
- {
- pid t pid;
- pid = fork();
- if (pid == 0) { /* child process */
- value += 15;
- return 0;
- }
- else if (pid > 0) { /* parent process */
- wait(NULL);
- printf("PARENT: value = %d", value); /* LINE A */
- return 0;
- }
- }
Add Comment
Please, Sign In to add comment