After calling fork,the current process will call exit(0)
.
But the child will continue.
switch(fork())
{
case -1:
exit(1);
case 0:
//child process,continue
break;
default:
//the current process,exit
exit(0);
}
How can I continue debug the child process in this case?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…