Guest User

Untitled

a guest
Jan 16th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.30 KB | None | 0 0
  1. #include <sys/types. h>
  2. #include <stdio. h>
  3. #include <unistd. h>
  4. int value = 5;
  5. int main()
  6. {
  7. pid t pid;
  8. pid = fork();
  9. if (pid == 0) { /* child process */
  10. value += 15;
  11. return 0;
  12. }
  13. else if (pid > 0) { /* parent process */
  14. wait(NULL);
  15. printf("PARENT: value = %d", value); /* LINE A */
  16. return 0;
  17. }
  18. }
Add Comment
Please, Sign In to add comment