summaryrefslogtreecommitdiff
path: root/src/modules.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-17 01:40:40 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-17 01:40:40 +0000
commit55bc98f87d824e2803141aef1632fffc6eef4496 (patch)
tree2e3d30e2dbe596b20b3e3da1a198aefbf41f8421 /src/modules.cpp
parent3b9fe8c5bfdfa57806994180bb9b8797cefb8279 (diff)
Experimental: Epoll support
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1408 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules.cpp')
-rw-r--r--src/modules.cpp21
1 files changed, 21 insertions, 0 deletions
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 <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);
}