Skip to content

Commit 9381763

Browse files
author
Mark Stapp
committed
lib: Support epoll APIs in thread management routine
This commit adds support for epoll APIs for better performance. This is controlled by a configure option. Note that epoll APIs are only available for Linux platforms. For BSD and other linux platforms which do not support epoll APIs, poll APIs are still used. Signed-off-by: Kaifei Peng <[email protected]> Signed-off-by: Mark Stapp <[email protected]>
1 parent 7270576 commit 9381763

File tree

3 files changed

+814
-122
lines changed

3 files changed

+814
-122
lines changed

configure.ac

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,6 +1599,24 @@ AC_CHECK_FUNCS([pollts], [
15991599
AC_DEFINE([HAVE_POLLTS], [1], [have NetBSD pollts()])
16001600
])
16011601

1602+
AC_ARG_ENABLE([epoll],
1603+
[AS_HELP_STRING([--enable-epoll], [Enable epoll support])],
1604+
[enable_epoll=yes],
1605+
[enable_epoll=no])
1606+
1607+
if test "x$enable_epoll" = "xyes"; then
1608+
AC_CHECK_FUNC([epoll_pwait], [AC_DEFINE([HAVE_EPOLL_PWAIT], [1], [Define if you have epoll_pwait])])
1609+
1610+
# Define USE_EPOLL if any of the above is found
1611+
AC_MSG_CHECKING([for epoll API support])
1612+
if test "x$ac_cv_func_epoll_pwait" = "xyes" ; then
1613+
AC_DEFINE([USE_EPOLL], [1], [Define if any epoll API is supported])
1614+
AC_MSG_RESULT([yes])
1615+
else
1616+
AC_MSG_RESULT([no])
1617+
fi
1618+
fi
1619+
16021620
AC_CHECK_HEADER([asm-generic/unistd.h],
16031621
[AC_CHECK_DECL(__NR_setns,
16041622
AC_DEFINE([HAVE_NETNS], [1], [Have netns]),,

0 commit comments

Comments
 (0)