summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-04 01:07:03 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-04 01:07:03 +0000
commit249fe0e74252af65c3e2e47a5e9e27eb839ad7c0 (patch)
tree8b74a241e4d2842dd1f96541fc59ef85185c6818 /include
parent9be37ca7d51513658f5f84d98fa5e46026cc5a04 (diff)
* 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
Diffstat (limited to 'include')
-rw-r--r--include/ruby/io.h14
1 files changed, 11 insertions, 3 deletions
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 <stdio_ext.h>
#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 <poll.h>
+# 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)