0

我有一个简单的服务器,它为新的套接字连接分叉。如果我signal(SIGCHLD, SIG_IGN);在调用子进程以执行所需的脚本时设置避免僵尸system() - 一切都执行得很好,但似乎子进程在退出之前从进程表中删除,所以这很奇怪。以下是输出示例:

server started. version 0.20
opening socket 
binding 
listening 
parent process does nothing
client message: print.php
executing php script: "print.php" 
full command line of execution: "php print.php" <-- we call system() which executes php script on server
Hello, World!                      <-- this is output of php script
return value from script execution: -1      <-- should be ok but -1 instead
system returns -1 error: No child processes
child is closing socket 
4

0 回答 0