Files
  • main.c
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <sys/types.h>
#include <stdio.h>
#include <sys/wait.h>
#include <unistd.h>
static int value = 5;
int main() {
	
	pid_t pid;
	pid = fork();
	if (pid == 0) { 
		/* child process */
		value += 15;
		return 0;
	}
	else {
	 /* parent process */
	 	wait(NULL);
		printf("PARENT: value = %d\n", value); /*LINE A*/
		return 0;
	}
}