From 55bc98f87d824e2803141aef1632fffc6eef4496 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 17 May 2005 01:40:40 +0000 Subject: Experimental: Epoll support git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1408 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/modules.cpp') diff --git a/src/modules.cpp b/src/modules.cpp index ffc6e0c8d..b53dd4f7f 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -22,11 +22,17 @@ using namespace std; #include "inspircd_config.h" #include #include + #ifdef USE_KQUEUE #include #include #include #endif + +#ifdef USE_EPOLL +#include +#endif + #include #include #ifdef GCC3 @@ -58,6 +64,10 @@ using namespace std; extern int kq; #endif +#ifdef USE_EPOLL +int ep; +#endif + extern int MODCOUNT; extern std::vector modules; extern std::vector factory; @@ -621,6 +631,17 @@ bool Server::UserToPseudo(userrec* user,std::string message) log(DEBUG,"kqueue: Failed to remove user from queue!"); } #endif +#ifdef USE_EPOLL + struct epoll_event ev; + ev.events = EPOLLIN | EPOLLET; + ev.data.fd = old_fd; + int i = epoll_ctl(ep, EPOLL_CTL_DEL, old_fd, &ev); + if (i < 0) + { + log(DEBUG,"epoll: List deletion failure!"); + } +#endif + shutdown(old_fd,2); close(old_fd); } -- cgit v1.2.3