LINE A 에서 출력되는게 뭔지 알고 싶은건데요 ㅠ
fork 요런건 윈도우에선 안돌아가는건가....?ㅠㅠ
어떻게 나올건지 혹시 아시는 분...ㅠㅠ???
#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;
}
else if (pid > 0) { /* parent process */
wait(NULL);
printf(\"PARENT: value = %d\", value); /* LINE A */
exit(0);
}
}
fork 는 리눅스 전용 시스템 콜이기 때문에 당연히 윈도우에선 못 쓰지. wait(NULL) 을 부모 쪽에서 호출하는 걸로 봐선 20이 나오겠군.