diff auto/os/linux @ 5372:36b58ddb566d

Events: support for EPOLLRDHUP (ticket #320). Since Linux 2.6.17, epoll is able to report about peer half-closed connection using special EPOLLRDHUP flag on a read event.
author Valentin Bartenev <vbart@nginx.com>
date Fri, 12 Jul 2013 14:51:07 +0400
parents acd51b0f6fd4
children adba26ff70b5
line wrap: on
line diff
--- a/auto/os/linux
+++ b/auto/os/linux
@@ -65,6 +65,22 @@ if [ $ngx_found = yes ]; then
     CORE_SRCS="$CORE_SRCS $EPOLL_SRCS"
     EVENT_MODULES="$EVENT_MODULES $EPOLL_MODULE"
     EVENT_FOUND=YES
+
+
+    # EPOLLRDHUP appeared in Linux 2.6.17, glibc 2.8
+
+    ngx_feature="EPOLLRDHUP"
+    ngx_feature_name="NGX_HAVE_EPOLLRDHUP"
+    ngx_feature_run=no
+    ngx_feature_incs="#include <sys/epoll.h>"
+    ngx_feature_path=
+    ngx_feature_libs=
+    ngx_feature_test="int efd = 0, fd = 0;
+                      struct epoll_event ee;
+                      ee.events = EPOLLIN|EPOLLRDHUP|EPOLLET;
+                      ee.data.ptr = NULL;
+                      epoll_ctl(efd, EPOLL_CTL_ADD, fd, &ee)"
+    . auto/feature
 fi