简介
int main()
{
int n = 0x00;
int pid = fork();
if (pid == -1)
return -1;
n = 10; // 修改两个进程共同都握有的一个页,此时将会触发cow
if (pid)
{
printf("I am father, my pid is %d\n", getpid());
return 0;
}
else
{
printf("I am child, my pid is %d\n", getpid());
return 0;
}
}