From 249fe0e74252af65c3e2e47a5e9e27eb839ad7c0 Mon Sep 17 00:00:00 2001 From: kosaki Date: Wed, 4 May 2011 01:07:03 +0000 Subject: * thread.c (rb_wait_for_single_fd): new. poll(2) based backend for rb_wait_for_single_fd(). Now only Linux uses it. The patch was written by Eric Wong. [Ruby 1.9 - Feature #4531] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/io.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'include/ruby/io.h') diff --git a/include/ruby/io.h b/include/ruby/io.h index bf1b9f8b37..cfdfaf1fb7 100644 --- a/include/ruby/io.h +++ b/include/ruby/io.h @@ -27,9 +27,17 @@ extern "C" { #include #endif -#define RB_WAITFD_IN 0x001 -#define RB_WAITFD_PRI 0x002 -#define RB_WAITFD_OUT 0x004 +#include "ruby/config.h" +#if defined(HAVE_POLL) +# include +# define RB_WAITFD_IN POLLIN +# define RB_WAITFD_PRI POLLPRI +# define RB_WAITFD_OUT POLLOUT +#else +# define RB_WAITFD_IN 0x001 +# define RB_WAITFD_PRI 0x002 +# define RB_WAITFD_OUT 0x004 +#endif #if defined __GNUC__ && __GNUC__ >= 4 #pragma GCC visibility push(default) -- cgit v1.2.3