Linux accept4() support

This commit is contained in:
Igor Sysoev 2010-11-25 10:15:04 +00:00
parent 601ca7cd6e
commit 40747ad861
3 changed files with 14 additions and 1 deletions

View file

@ -46,7 +46,11 @@ ngx_event_accept(ngx_event_t *ev)
do {
socklen = NGX_SOCKADDRLEN;
#if (NGX_HAVE_ACCEPT4)
s = accept4(lc->fd, (struct sockaddr *) sa, &socklen, SOCK_NONBLOCK);
#else
s = accept(lc->fd, (struct sockaddr *) sa, &socklen);
#endif
if (s == -1) {
err = ngx_socket_errno;

View file

@ -60,7 +60,7 @@ ngx_os_init(ngx_log_t *log)
ngx_max_sockets = (ngx_int_t) rlmt.rlim_cur;
#if (NGX_HAVE_INHERITED_NONBLOCK)
#if (NGX_HAVE_INHERITED_NONBLOCK || NGX_HAVE_ACCEPT4)
ngx_inherited_nonblocking = 1;
#else
ngx_inherited_nonblocking = 0;