diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2010-12-17 14:59:44 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2010-12-17 14:59:44 +0100 |
commit | 8d862730d297cbf88d9301b7a4cbee47a3f8fb9e (patch) | |
tree | 45daabe8ff0b0cdcfa27fb29eff1f34250a9dcbd /plugins | |
parent | cc8237736d11b54a3d6089d836da7ccb6972a29c (diff) | |
download | rsyslog-8d862730d297cbf88d9301b7a4cbee47a3f8fb9e.tar.gz rsyslog-8d862730d297cbf88d9301b7a4cbee47a3f8fb9e.tar.xz rsyslog-8d862730d297cbf88d9301b7a4cbee47a3f8fb9e.zip |
added support for systems without epoll_create1()
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/imptcp/imptcp.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/plugins/imptcp/imptcp.c b/plugins/imptcp/imptcp.c index 93906ba0..2afb340f 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> @@ -1040,7 +1047,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); } |