summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/socket/extconf.rb2
-rw-r--r--ext/socket/socket.c13
2 files changed, 14 insertions, 1 deletions
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index 234f373170..5cdc949d8f 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -194,7 +194,7 @@ end
have_header("netinet/tcp.h") if not /cygwin/ =~ RUBY_PLATFORM # for cygwin 1.1.5
have_header("netinet/udp.h")
-if have_func("sendmsg") or have_func("recvmsg")
+if have_func("sendmsg") | have_func("recvmsg")
have_struct_member('struct msghdr', 'msg_control', header=['sys/types.h', 'sys/socket.h'])
have_struct_member('struct msghdr', 'msg_accrights', header=['sys/types.h', 'sys/socket.h'])
end
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index ca7bdc50c2..95ec45bfe6 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -1502,6 +1502,19 @@ unix_send_io(sock, val)
#endif
}
+#if defined(HAVE_RECVMSG) && (defined(HAVE_ST_MSG_CONTROL) || defined(HAVE_ST_MSG_ACCRIGHTS))
+static void
+thread_read_select(fd)
+ int fd;
+{
+ fd_set fds;
+
+ FD_ZERO(&fds);
+ FD_SET(fd, &fds);
+ rb_thread_select(fd+1, &fds, 0, 0, 0);
+}
+#endif
+
static VALUE
unix_recv_io(argc, argv, sock)
int argc;