]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules.cpp
Experimental: Epoll support
[user/henk/code/inspircd.git] / src / modules.cpp
index ffc6e0c8dcf36ce61c7c9a22f8875098dfb64052..b53dd4f7f9c27534815e560e248049c80a4f9703 100644 (file)
@@ -22,11 +22,17 @@ using namespace std;
 #include "inspircd_config.h"
 #include <unistd.h>
 #include <sys/errno.h>
+
 #ifdef USE_KQUEUE
 #include <sys/types.h>
 #include <sys/event.h>
 #include <sys/time.h>
 #endif
+
+#ifdef USE_EPOLL
+#include <sys/epoll.h>
+#endif
+
 #include <time.h>
 #include <string>
 #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<Module*> modules;
 extern std::vector<ircd_module*> 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);
 }