diff options
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -10643,15 +10643,21 @@ maygvl_copy_stream_continue_p(int has_gvl, struct copy_stream_struct *stp) } /* non-Linux poll may not work on all FDs */ -#if defined(HAVE_POLL) && defined(__linux__) -# define USE_POLL 1 -# define IOWAIT_SYSCALL "poll" -#else -# define IOWAIT_SYSCALL "select" +#if defined(HAVE_POLL) +# if defined(__linux__) +# define USE_POLL 1 +# endif +# if defined(__FreeBSD_version) && __FreeBSD_version >= 1100000 +# define USE_POLL 1 +# endif +#endif + +#ifndef USE_POLL # define USE_POLL 0 #endif #if USE_POLL +# define IOWAIT_SYSCALL "poll" STATIC_ASSERT(pollin_expected, POLLIN == RB_WAITFD_IN); STATIC_ASSERT(pollout_expected, POLLOUT == RB_WAITFD_OUT); static int @@ -10665,6 +10671,7 @@ nogvl_wait_for_single_fd(int fd, short events) return poll(&fds, 1, -1); } #else /* !USE_POLL */ +# define IOWAIT_SYSCALL "select" static int nogvl_wait_for_single_fd(int fd, short events) { |