summaryrefslogtreecommitdiffstats
path: root/plugins/imptcp
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2010-11-25 18:04:00 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2010-11-25 18:04:00 +0100
commit786a44a0243cc6a5b0d47fb15f8f20a1a3f5bf0e (patch)
tree1948874c8d8b7a876ad5e3817a292889b94a68d4 /plugins/imptcp
parent950fe206f84322bdff755988403a9d4017ec26f4 (diff)
parent44300ddcb2904105e2ecd56479bf396399dcab26 (diff)
downloadrsyslog-786a44a0243cc6a5b0d47fb15f8f20a1a3f5bf0e.tar.gz
rsyslog-786a44a0243cc6a5b0d47fb15f8f20a1a3f5bf0e.tar.xz
rsyslog-786a44a0243cc6a5b0d47fb15f8f20a1a3f5bf0e.zip
Merge branch 'v5-devel'
Conflicts: runtime/rsyslog.h
Diffstat (limited to 'plugins/imptcp')
-rw-r--r--plugins/imptcp/imptcp.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/plugins/imptcp/imptcp.c b/plugins/imptcp/imptcp.c
index db13e2cb..2ff292c2 100644
--- a/plugins/imptcp/imptcp.c
+++ b/plugins/imptcp/imptcp.c
@@ -30,6 +30,13 @@
* A copy of the GPL can be found in the file "COPYING" in this distribution.
*/
#include "config.h"
+#if !defined(HAVE_EPOLL_CREATE)
+# error imptcp requires OS support for epoll - can not build
+ /* imptcp gains speed by using modern Linux capabilities. As such,
+ * it can only be build on platforms supporting the epoll API.
+ */
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
@@ -1039,7 +1046,18 @@ CODESTARTwillRun
ABORT_FINALIZE(RS_RET_NO_RUN);
}
- if((epollfd = epoll_create1(EPOLL_CLOEXEC)) < 0) {
+# if defined(EPOLL_CLOEXEC) && defined(HAVE_EPOLL_CREATE1)
+ DBGPRINTF("imptcp uses epoll_create1()\n");
+ epollfd = epoll_create1(EPOLL_CLOEXEC);
+# else
+ DBGPRINTF("imptcp uses epoll_create()\n");
+ /* reading the docs, the number of epoll events passed to
+ * epoll_create() seems not to be used at all in kernels. So
+ * we just provide "a" number, happens to be 10.
+ */
+ epollfd = epoll_create(10);
+# endif
+ if(epollfd < 0) {
errmsg.LogError(0, RS_RET_EPOLL_CR_FAILED, "error: epoll_create() failed");
ABORT_FINALIZE(RS_RET_NO_RUN);
}