#include
main()
{
if(vfork() ==0)
{
printf(“This is the child process\n”);
}else{
printf(“This is the parent process\n”);
}
}
这段代码编译运行完,在最后报了一个segment fault 的错误,在最后加上exit(1)就没报了, 为何呢?
还不明原因
#include
main()
{
if(vfork() ==0)
{
printf(“This is the child process\n”);
}else{
printf(“This is the parent process\n”);
}
exit(1);
}
阅读(1238) | 评论(0) | 转发(0) |