mirror of
https://github.com/nginx/nginx.git
synced 2024-12-27 17:31:35 -06:00
Linux accept4() support
This commit is contained in:
parent
601ca7cd6e
commit
40747ad861
@ -305,6 +305,15 @@ ngx_feature_test="setsockopt(0, SOL_SOCKET, SO_SETFIB, NULL, 4)"
|
|||||||
. auto/feature
|
. auto/feature
|
||||||
|
|
||||||
|
|
||||||
|
ngx_feature="accept4()"
|
||||||
|
ngx_feature_name="NGX_HAVE_ACCEPT4"
|
||||||
|
ngx_feature_run=no
|
||||||
|
ngx_feature_incs="#include <sys/socket.h>"
|
||||||
|
ngx_feature_path=
|
||||||
|
ngx_feature_libs=
|
||||||
|
ngx_feature_test="accept4(0, NULL, NULL, SOCK_NONBLOCK)"
|
||||||
|
. auto/feature
|
||||||
|
|
||||||
if [ $NGX_FILE_AIO = YES ]; then
|
if [ $NGX_FILE_AIO = YES ]; then
|
||||||
|
|
||||||
ngx_feature="kqueue AIO support"
|
ngx_feature="kqueue AIO support"
|
||||||
|
@ -46,7 +46,11 @@ ngx_event_accept(ngx_event_t *ev)
|
|||||||
do {
|
do {
|
||||||
socklen = NGX_SOCKADDRLEN;
|
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);
|
s = accept(lc->fd, (struct sockaddr *) sa, &socklen);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (s == -1) {
|
if (s == -1) {
|
||||||
err = ngx_socket_errno;
|
err = ngx_socket_errno;
|
||||||
|
@ -60,7 +60,7 @@ ngx_os_init(ngx_log_t *log)
|
|||||||
|
|
||||||
ngx_max_sockets = (ngx_int_t) rlmt.rlim_cur;
|
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;
|
ngx_inherited_nonblocking = 1;
|
||||||
#else
|
#else
|
||||||
ngx_inherited_nonblocking = 0;
|
ngx_inherited_nonblocking = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user