summaryrefslogtreecommitdiff
path: root/ext/io/wait
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-26 09:11:40 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-26 09:11:40 +0000
commitbcf61f58d518308658de1c208703bfdd7f79d1c7 (patch)
treea788ebb5623c06fce878abe2ac490ed3949fdf10 /ext/io/wait
parent201eb37d92b9e4729a38a1ea4a7b4cbf2654bd62 (diff)
* ext/io/wait/{extconf.rb,wait.c}: needs sys/ioctl.h for fcntl on
cygwin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/io/wait')
-rw-r--r--ext/io/wait/extconf.rb3
-rw-r--r--ext/io/wait/wait.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/ext/io/wait/extconf.rb b/ext/io/wait/extconf.rb
index 1a0edbd846e..eed35431242 100644
--- a/ext/io/wait/extconf.rb
+++ b/ext/io/wait/extconf.rb
@@ -2,8 +2,9 @@ require 'mkmf'
target = "io/wait"
unless macro_defined?("DOSISH", "#include <ruby.h>")
+ have_header(ioctl_h = "sys/ioctl.h") or ioctl_h = nil
fionread = %w[sys/ioctl.h sys/filio.h sys/socket.h].find do |h|
- have_macro("FIONREAD", h)
+ have_macro("FIONREAD", [h, ioctl_h].compact)
end
if fionread
$defs << "-DFIONREAD_HEADER=\"<#{fionread}>\""
diff --git a/ext/io/wait/wait.c b/ext/io/wait/wait.c
index c073f1de306..42f5e8fc480 100644
--- a/ext/io/wait/wait.c
+++ b/ext/io/wait/wait.c
@@ -14,6 +14,9 @@
#include "ruby/io.h"
#include <sys/types.h>
+#if defined(HAVE_SYS_IOCTL_H)
+#include <sys/ioctl.h>
+#endif
#if defined(FIONREAD_HEADER)
#include FIONREAD_HEADER
#endif