25 November, 2009

FastCGI: non-blocking FCGI_Accept_r

1. FCGX_InitRequest(&request, 0, FCGI_FAIL_ACCEPT_ON_INTR)
2.
int flags = fcntl(0, F_GETFL, 0);
fcntl(0, F_SETFL, flags | O_NONBLOCK);
3. sigaction


"We intentionally try to set the SA_RESTART flag for all signals other than SIGALRM, so that any system call interrupted by these other signals is automatically restarted. The reason we don't want SIGALRM restarted is to allow us to set a timeout for I/O operations."

No comments: