【发布时间】:2016-01-01 06:09:07
【问题描述】:
#include<stdio.h>
#include<sys/types.h>
#include<unistd.h>
int main()
{
int status;
int pid = fork();assigned to variable "pid"
if(pid == 0)
{
printf("I am the child with pid = %d\n", getpid());
}
else
{
printf("I am the parent with pid = %d\n", getpid());
waitpid(pid, &status, 0); // line 51
}
return 0;
}
在第 51 行,请澄清“pid”参数。这个过程会等待什么?
【问题讨论】:
-
这里逐字复制作业:-1