From fc16d602361fdded972b637cb64a7c760bdb8767 Mon Sep 17 00:00:00 2001 From: Brian Barrett Date: Fri, 6 May 2005 15:10:35 +0000 Subject: [PATCH] * Don't use poll() on OS X. It's implemented on top of select in 10.3 (no biggie), so we gain nothing there. On 10.4, it's implemented directly, but doesn't support devices (which messes up pty support and IO forwarding). This commit was SVN r5621. --- config/ompi_setup_libevent.m4 | 16 +++++++++++++++- src/event/event.c | 4 ++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/config/ompi_setup_libevent.m4 b/config/ompi_setup_libevent.m4 index ae890f0b11..95ac5ecb8b 100644 --- a/config/ompi_setup_libevent.m4 +++ b/config/ompi_setup_libevent.m4 @@ -78,7 +78,21 @@ fi havepoll=no havertsig=no AC_CHECK_FUNCS(poll, [havepoll=yes], ) -if test "x$havepoll" = "xyes" ; then +case "$host" in + *apple-darwin*) + haveworkingpoll=0 + ;; + *) + if test "$havepoll" = "yes" ; then + haveworkingpoll=1 + else + haveworkingpoll=0 + fi + ;; +esac +AC_DEFINE_UNQUOTED([HAVE_WORKING_POLL], [$haveworkingpoll], + [Whether poll works for file descriptors and devices]) +if test "x$havepoll" = "xyes" -a "$haveworkingpoll" = "1" ; then # OMPI: Don't use AC_LIBOBJ sources="poll.c $sources" needsignal=yes diff --git a/src/event/event.c b/src/event/event.c index 9c155d4506..6818324faf 100644 --- a/src/event/event.c +++ b/src/event/event.c @@ -69,7 +69,7 @@ #if defined(HAVE_SELECT) && HAVE_SELECT extern const struct ompi_eventop ompi_selectops; #endif -#if defined(HAVE_POLL) && HAVE_POLL +#if defined(HAVE_POLL) && HAVE_POLL && HAVE_WORKING_POLL extern const struct ompi_eventop ompi_pollops; #endif #if defined(HAVE_RTSIG) && HAVE_RTSIG @@ -104,7 +104,7 @@ static const struct ompi_eventop *ompi_eventops[] = { &ompi_rtsigops, #endif #endif -#if defined(HAVE_POLL) && HAVE_POLL +#if defined(HAVE_POLL) && HAVE_POLL && HAVE_WORKING_POLL &ompi_pollops, #endif #if defined(HAVE_SELECT) && HAVE_SELECT