summaryrefslogtreecommitdiff
path: root/src/threadengines/threadengine_pthread.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-03-23 18:49:06 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-03-23 18:49:06 +0000
commit58eae4fc8af1602396da456aab109eca8aaed7d6 (patch)
treeeaef18352cc4329dac0b662e115b987ea978237f /src/threadengines/threadengine_pthread.cpp
parent85a787b92b6de419fab2cd4fe118c0c7d47066d6 (diff)
Add test-compile checks for epoll and eventfd
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11253 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/threadengines/threadengine_pthread.cpp')
-rw-r--r--src/threadengines/threadengine_pthread.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/threadengines/threadengine_pthread.cpp b/src/threadengines/threadengine_pthread.cpp
index 5aef0f247..a4f42eba9 100644
--- a/src/threadengines/threadengine_pthread.cpp
+++ b/src/threadengines/threadengine_pthread.cpp
@@ -15,6 +15,7 @@
#include "threadengines/threadengine_pthread.h"
#include <pthread.h>
#include <signal.h>
+#include <fcntl.h>
ThreadEngine::ThreadEngine(InspIRCd* Instance)
{
@@ -57,11 +58,7 @@ void ThreadData::FreeThread(Thread* thread)
pthread_join(pthread_id, NULL);
}
-#if 0
-/* TODO this is a linux-specific syscall that allows signals to be
- * sent using a single file descriptor, rather than 2 for a pipe.
- * Requires glibc 2.8, kernel 2.6.22+
- */
+#ifdef HAS_EVENTFD
#include <sys/eventfd.h>
class ThreadSignalSocket : public BufferedSocket
@@ -92,7 +89,7 @@ class ThreadSignalSocket : public BufferedSocket
SocketThread::SocketThread(InspIRCd* SI)
{
- int fd = eventfd(0, 0); // TODO nonblock
+ int fd = eventfd(0, O_NONBLOCK);
if (fd < 0)
throw new CoreException("Could not create pipe " + std::string(strerror(errno)));
signal.sock = new ThreadSignalSocket(this, SI, fd);