|
|

楼主 |
发表于 2006-2-15 16:25:01
|
显示全部楼层
[php]
pid_t pid_buf;
fun()
{
pid_t pid;
sigset_t sig, oldsig;
sigfillset (&sig);
sigprocmask (SIG_BLOCK, &sig, &oldsig);
pid = fork ();
if (pid == -1)
{
perror ("fork");
exit (-1);
}
else if (pid == 0)
{ //child
sigprocmask (SIG_SETMASK, &oldsig, NULL);
child进程代码;
}
else
{ // parent
pid_buf = pid;
sigprocmask (SIG_SETMASK, &oldsig, NULL);
}
}
[/php]
这样做不行,为什么? |
|