Skip to content

Commit

Permalink
move the pollset to the position between devpoll and poll
Browse files Browse the repository at this point in the history
  • Loading branch information
hnwyllmm committed Sep 21, 2016
1 parent c964b7c commit eee7880
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 36 deletions.
22 changes: 11 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ if (WITH_MILITANT)
endif()

set (POLLER "" CACHE STRING "Choose polling system. valid values are
kqueue, pollset, epoll, devpoll, poll or select [default=autodetect]")
kqueue, epoll, devpoll, pollset, poll or select [default=autodetect]")

include (CheckFunctionExists)
include (CheckTypeSize)
Expand All @@ -91,15 +91,6 @@ if (POLLER STREQUAL "")
endif()
endif ()

if (POLLER STREQUAL "")
set (CMAKE_REQUIRED_INCLUDES sys/pollset.h)
check_function_exists (pollset_create HAVE_POLLSET)
set (CMAKE_REQUIRED_INCLUDES)
if (HAVE_POLLSET)
set (POLLER "pollset")
endif()
endif ()

if (POLLER STREQUAL "")
set (CMAKE_REQUIRED_INCLUDES sys/epoll.h)
check_function_exists (epoll_create HAVE_EPOLL)
Expand All @@ -118,6 +109,15 @@ if (POLLER STREQUAL "")
endif ()
endif ()

if (POLLER STREQUAL "")
set (CMAKE_REQUIRED_INCLUDES sys/pollset.h)
check_function_exists (pollset_create HAVE_POLLSET)
set (CMAKE_REQUIRED_INCLUDES)
if (HAVE_POLLSET)
set (POLLER "pollset")
endif()
endif ()

if (POLLER STREQUAL "")
set (CMAKE_REQUIRED_INCLUDES poll.h)
check_function_exists (poll HAVE_POLL)
Expand Down Expand Up @@ -145,9 +145,9 @@ if (POLLER STREQUAL "")
endif ()

if (POLLER STREQUAL "kqueue"
OR POLLER STREQUAL "pollset"
OR POLLER STREQUAL "epoll"
OR POLLER STREQUAL "devpoll"
OR POLLER STREQUAL "pollset"
OR POLLER STREQUAL "poll"
OR POLLER STREQUAL "select")
message (STATUS "Detected ${POLLER} polling method")
Expand Down
50 changes: 25 additions & 25 deletions acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -794,22 +794,6 @@ kqueue();
)
}])

dnl ################################################################################
dnl # LIBZMQ_CHECK_POLLER_POLLSET([action-if-found], [action-if-not-found]) #
dnl # Checks pollset polling system #
dnl ################################################################################
AC_DEFUN([LIBZMQ_CHECK_POLLER_POLLSET], [{
AC_LINK_IFELSE([
AC_LANG_PROGRAM([
#include <sys/poll.h>
#include <sys/pollset.h>
],[[
pollset_t ps = pollset_create(-1);
]])],
[$1], [$2]
)
}])

dnl ################################################################################
dnl # LIBZMQ_CHECK_POLLER_EPOLL_RUN([action-if-found], [action-if-not-found]) #
dnl # Checks epoll polling system can actually run #
Expand Down Expand Up @@ -855,6 +839,22 @@ int fd = open("/dev/poll", O_RDWR);
)
}])

dnl ################################################################################
dnl # LIBZMQ_CHECK_POLLER_POLLSET([action-if-found], [action-if-not-found]) #
dnl # Checks pollset polling system #
dnl ################################################################################
AC_DEFUN([LIBZMQ_CHECK_POLLER_POLLSET], [{
AC_LINK_IFELSE([
AC_LANG_PROGRAM([
#include <sys/poll.h>
#include <sys/pollset.h>
],[[
pollset_t ps = pollset_create(-1);
]])],
[$1], [$2]
)
}])

dnl ################################################################################
dnl # LIBZMQ_CHECK_POLLER_POLL([action-if-found], [action-if-not-found]) #
dnl # Checks poll polling system #
Expand Down Expand Up @@ -908,7 +908,7 @@ AC_DEFUN([LIBZMQ_CHECK_POLLER], [{
# Allow user to override poller autodetection
AC_ARG_WITH([poller],
[AS_HELP_STRING([--with-poller],
[choose polling system manually. Valid values are 'kqueue', 'pollset', 'epoll', 'devpoll', 'poll', 'select', or 'auto'. [default=auto]])])
[choose polling system manually. Valid values are 'kqueue', 'epoll', 'devpoll', 'pollset', 'poll', 'select', or 'auto'. [default=auto]])])
if test "x$with_poller" == "x"; then
pollers=auto
Expand All @@ -917,7 +917,7 @@ AC_DEFUN([LIBZMQ_CHECK_POLLER], [{
fi
if test "$pollers" == "auto"; then
# We search for pollers in this order
pollers="kqueue pollset epoll devpoll poll select"
pollers="kqueue epoll devpoll pollset poll select"
fi
# try to find suitable polling system. the order of testing is:
Expand All @@ -932,13 +932,6 @@ AC_DEFUN([LIBZMQ_CHECK_POLLER], [{
poller_found=1
])
;;
pollset)
LIBZMQ_CHECK_POLLER_POLLSET([
AC_MSG_NOTICE([Using 'pollset' polling system])
AC_DEFINE(ZMQ_USE_POLLSET, 1, [Use 'pollset' polling system])
poller_found=1
])
;;
epoll)
LIBZMQ_CHECK_POLLER_EPOLL([
AC_MSG_NOTICE([Using 'epoll' polling system])
Expand All @@ -953,6 +946,13 @@ AC_DEFUN([LIBZMQ_CHECK_POLLER], [{
poller_found=1
])
;;
pollset)
LIBZMQ_CHECK_POLLER_POLLSET([
AC_MSG_NOTICE([Using 'pollset' polling system])
AC_DEFINE(ZMQ_USE_POLLSET, 1, [Use 'pollset' polling system])
poller_found=1
])
;;
poll)
LIBZMQ_CHECK_POLLER_POLL([
AC_MSG_NOTICE([Using 'poll' polling system])
Expand Down

0 comments on commit eee7880

Please sign in to comment.