Home  >  Q&A  >  body text

linux - 处理SIGCHLD信号时子进程自动重启

PHP中文网PHP中文网2718 days ago297

reply all(1)I'll reply

  • 巴扎黑

    巴扎黑2017-04-17 15:04:05

    I don’t quite understand. Accept just returns an EINTR error, which is just a normal function return. The parent process will continue to execute fork, but it is meaningless at this time because the value of connfd is definitely illegal (-1). The original book determines the value of connfd and has this code under accept:

    if(errno == EINTR)
        continue;
    else
        err_say("accept error");
        

    This will stop it.

    reply
    0
  • Cancelreply