mirror of
https://github.com/nginx/nginx.git
synced 2026-09-01 02:58:40 +00:00
Linux accept4() support
This commit is contained in:
parent
601ca7cd6e
commit
40747ad861
3 changed files with 14 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue