Klaus Demo nginx / 40747ad
Linux accept4() support Igor Sysoev 11 years ago
3 changed file(s) with 14 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
303303 ngx_feature_test="setsockopt(0, SOL_SOCKET, SO_SETFIB, NULL, 4)"
304304 . auto/feature
305305
306
307 ngx_feature="accept4()"
308 ngx_feature_name="NGX_HAVE_ACCEPT4"
309 ngx_feature_run=no
310 ngx_feature_incs="#include <sys/socket.h>"
311 ngx_feature_path=
312 ngx_feature_libs=
313 ngx_feature_test="accept4(0, NULL, NULL, SOCK_NONBLOCK)"
314 . auto/feature
306315
307316 if [ $NGX_FILE_AIO = YES ]; then
308317
4545 do {
4646 socklen = NGX_SOCKADDRLEN;
4747
48 #if (NGX_HAVE_ACCEPT4)
49 s = accept4(lc->fd, (struct sockaddr *) sa, &socklen, SOCK_NONBLOCK);
50 #else
4851 s = accept(lc->fd, (struct sockaddr *) sa, &socklen);
52 #endif
4953
5054 if (s == -1) {
5155 err = ngx_socket_errno;
5959
6060 ngx_max_sockets = (ngx_int_t) rlmt.rlim_cur;
6161
62 #if (NGX_HAVE_INHERITED_NONBLOCK)
62 #if (NGX_HAVE_INHERITED_NONBLOCK || NGX_HAVE_ACCEPT4)
6363 ngx_inherited_nonblocking = 1;
6464 #else
6565 ngx_inherited_nonblocking = 0;