summaryrefslogtreecommitdiff
path: root/test/socket
AgeCommit message (Collapse)Author
2015-07-21test/socket/test_nonblock.rb: increase buffer sizes to OpenBSD limitsnormal
* test/socket/test_nonblock.rb: increase buffer sizes to OpenBSD limits. Thanks to Jeremy Evans <code@jeremyevans.net> [ruby-core:70058] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-17test/socket/test_nonblock: use smaller buffer for sendmsgnormal
OpenBSD's limit is less than 128. * test/socket/test_nonblock: use smaller buffer for sendmsg Patch-by: Jeremy Evans <code@jeremyevans.net> [ruby-core:70016] [Bug #11364] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-13use Timeout.timeoutnobu
* time: Object#timeout has been deprecated a long time ago, use Timeout.timeout. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-18test/socket/test_unix.rb: replace sleep with selectnormal
Not sure what drugs I was on, but blindly sleeping instead of using IO#wait or IO.select to wait for data on a socket is completely wrong. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-16test_nonblock.rb: use assert_predicatenobu
* test/socket/test_nonblock.rb (test_recv_nonblock_no_exception), (test_recvfrom_nonblock_no_exception): use assert_predicate for failure messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-16test_nonblock.rb: fix failure on OSXnobu
* test/socket/test_nonblock.rb (test_recvfrom_nonblock_no_exception): no destination to already connected socket. fix failure on OSX. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-15socket: allow explicit buffer for recv and recv_nonblocknormal
This reduces GC overhead and makes the API more consistent with IO#read and IO#read_nonblock. * ext/socket/basicsocket.c (bsock_recv): document outbuf * ext/socket/unixsocket.c (unix_recvfrom): ditto * ext/socket/init.c (rsock_strbuf, recvfrom_locktmp): new functions (rsock_s_recvfrom): support destination buffer as 3rd arg (rsock_s_recvfrom_nonblock): ditto * string.c (rb_str_locktmp_ensure): export for internal ext * test/socket/test_nonblock.rb: test recv_nonblock * test/socket/test_unix.rb: test recv [ruby-core:69543] [Feature #11242] Benchmark results: user system total real alloc 0.130000 0.280000 0.410000 ( 0.420656) extbuf 0.100000 0.220000 0.320000 ( 0.318708) -------------------8<-------------------- require 'socket' require 'benchmark' nr = 100000 msg = ' ' * 16384 size = msg.bytesize buf = ' ' * size UNIXSocket.pair(:DGRAM) do |a, b| Benchmark.bmbm do |x| x.report('alloc') do nr.times do b.send(msg, 0) a.recv(size, 0) end end x.report('extbuf') do nr.times do b.send(msg, 0) a.recv(size, 0, buf) end end end end git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-15socket: allow exception-free nonblocking sendmsg/recvmsgnormal
As documented before, exceptions are expensive and IO::Wait*able are too common in socket applications to be the exceptional case. Datagram sockets deserve the same API which stream sockets are allowed with read_nonblock and write_nonblock. Note: this does not offer a performance advantage under optimal conditions when both ends are equally matched in speed, but it it does make debug output cleaner by avoiding exceptions whenever the receiver slows down. * ext/socket/ancdata.c (bsock_sendmsg_internal, bsock_recvmsg_internal): support "exception: false" kwarg * ext/socket/init.c (rsock_s_recvfrom_nonblock): ditto * ext/socket/init.c (rsock_s_recvfrom_nonblock): use rsock_opt_false_p * ext/socket/socket.c (sock_connect_nonblock): ditto * ext/socket/rubysocket.h (rsock_opt_false_p): new function * ext/socket/basicsocket.c (bsock_recv_nonblock): update rdoc * ext/socket/udpsocket.c (udp_recvfrom_nonblock): ditto * test/socket/test_nonblock.rb: new tests [ruby-core:69542] [Feature #11229] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-05test/socket/test_nonblock.rb: try to avoid EMSGSIZEnormal
We want to test the IO::WaitWritable behavior, so silently discarding Errno::EMSGSIZE prevents the test from being effective. [ruby-core:69466] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-04FreeBSD raises Errno::EMSGSIZEnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-02use assert_raisenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-02test_nonblock.rb: skip if EPROTONOSUPPORTnobu
* test/socket/test_nonblock.rb (test_sendmsg_nonblock_seqpacket): OSX raises EPROTONOSUPPORT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-02test/socket/test_nonblock.rb: new test for sendmsg_nonblocknormal
sendmsg_nonblock was not tested on any of my systems due to the common 64K limit. I also don't believe UDP sockets are at all a useful candidate for sendmsg_nonblock testing since they should never block on sending. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-18test_nonblock.rb: refine failure messagenobu
* test/socket/test_nonblock.rb (test_accept_nonblock): refine assertion for better failure message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-17ext/socket/init.c: use SOCK_NONBLOCK if availablenormal
This saves a system call by allowing us to use SOCK_NONBLOCK in Linux when accept4 is available. Note: I do not agree accept_nonblock should always make accepted sockets non-blocking, and will propose a future API to allow controlling whether accepted sockets are non-blocking or not regardless of how they were created. * ext/socket/init.c (cloexec_accept): support nonblock flag and use SOCK_NONBLOCK if possible * ext/socket/init.c (rsock_s_accept_nonblock): update cloexec_accept call * ext/socket/init.c (accept_blocking): ditto for blocking * test/socket/test_nonblock.rb: check nonblock? on accepted socket [Feature #11138] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-20connect_nonblock(..., exception: false) does not raise EISCONNnormal
* ext/socket/socket.c (sock_connect_nonblock): do not raise EISCONN [ruby-core:68926] [Feature #11072] * test/socket/test_nonblock.rb: check non-EISCONN on 2nd connect This is to reduce exceptions for code which issues a (IMHO, unnecessary) second connect() syscall. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12connect_nonblock supports "exception: false"normal
This is for consistency with accept_nonblock arguments and gives a minor speedup from avoiding exceptions. [ruby-core:68838] [Feature #11024] * ext/openssl/ossl_ssl.c (ossl_ssl_connect_nonblock): support `exception: false' * (get_no_exception): move function location * ext/socket/socket.c (sock_connect_nonblock): support `exception: false' * test/openssl/test_pair.rb (test_connect_accept_nonblock_no_exception): test `exception: false' on connect, rename from `test_accept_nonblock_no_exception' * test/socket/test_nonblock.rb (test_connect_nonblock_no_exception): new test Benchmark results: default 0.050000 0.100000 0.150000 ( 0.151307) exception: false 0.030000 0.080000 0.110000 ( 0.108840) ----------------------------8<----------------------- require 'socket' require 'benchmark' require 'io/wait' require 'tmpdir' host = '127.0.0.1' serv = TCPServer.new(host, 0) # UNIX sockets may not hit EINPROGRESS nr = 5000 # few iterations to avoid running out of ports addr = serv.getsockname pid = fork do begin serv.accept.close rescue => e warn "#$$: #{e.message} (#{e.class})" end while true end at_exit { Process.kill(:TERM, pid) } serv.close Benchmark.bmbm do |x| x.report("default") do nr.times do s = Socket.new(:INET, :STREAM) s.setsockopt(:SOL_SOCKET, :SO_REUSEADDR, 1) begin s.connect_nonblock(addr) rescue IO::WaitWritable s.wait_writable end s.close end end x.report("exception: false") do nr.times do s = Socket.new(:INET, :STREAM) s.setsockopt(:SOL_SOCKET, :SO_REUSEADDR, 1) case s.connect_nonblock(addr, exception: false) when :wait_writable s.wait_writable end s.close end end end git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-10test_addrinfo.rb: relax memory usage criterionnobu
* test/socket/test_addrinfo.rb (test_marshal_memory_leak): relax the criterion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-08raddrinfo.c: fix memory leaknobu
* ext/socket/raddrinfo.c (addrinfo_mload): fix memory leak of addrinfo. [ruby-dev:48923] [Bug #11051] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-12accept_nonblock supports "exception: false"normal
This is analogous to functionality found in IO#read_nonblock and IO#wait_nonblock. Raising exceptions for common failures on non-blocking servers is expensive and makes $DEBUG too noisy. Benchmark results: user system total real default 2.790000 0.870000 3.660000 ( 3.671597) exception: false 1.120000 0.800000 1.920000 ( 1.922032) exception: false (cached arg) 0.820000 0.770000 1.590000 ( 1.589267) --------------------- benchmark script ------------------------ require 'socket' require 'benchmark' require 'tmpdir' nr = 1000000 Dir.mktmpdir('nb_bench') do |path| sock_path = "#{path}/test.sock" s = UNIXServer.new(sock_path) Benchmark.bmbm do |x| x.report("default") do nr.times do begin s.accept_nonblock rescue IO::WaitReadable end end end x.report("exception: false") do nr.times do begin s.accept_nonblock(exception: false) rescue IO::WaitReadable abort "should not raise" end end end x.report("exception: false (cached arg)") do arg = { exception: false } nr.times do begin s.accept_nonblock(arg) rescue IO::WaitReadable abort "should not raise" end end end end end * ext/socket/init.c (rsock_s_accept_nonblock): support exception: false [ruby-core:66385] [Feature #10532] * ext/socket/init.c (rsock_init_socket_init): define new symbols * ext/socket/rubysocket.h: adjust prototype * ext/socket/socket.c (sock_accept_nonblock): support exception: false * ext/openssl/ossl_ssl.c (ossl_ssl_accept_nonblock): ditto * ext/socket/socket.c (Init_socket): adjust accept_nonblock definition * ext/openssl/ossl_ssl.c (Init_ossl_ssl): ditto * ext/socket/tcpserver.c (rsock_init_tcpserver): ditto * ext/socket/unixserver.c (rsock_init_unixserver): ditto * ext/socket/tcpserver.c (tcp_accept_nonblock): adjust rsock_s_accept_nonblock call * ext/socket/unixserver.c (unix_accept_nonblock): ditto * ext/openssl/ossl_ssl.c (ossl_start_ssl): support no_exception * ext/openssl/ossl_ssl.c (ossl_ssl_connect): adjust ossl_start_ssl call * ext/openssl/ossl_ssl.c (ossl_ssl_connect_nonblock): ditto * ext/openssl/ossl_ssl.c (ossl_ssl_accept): ditto * test/socket/test_nonblock.rb (test_accept_nonblock): test for "exception :false" * test/socket/test_tcp.rb (test_accept_nonblock): new test * test/socket/test_unix.rb (test_accept_nonblock): ditto * test/openssl/test_pair.rb (test_accept_nonblock_no_exception): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-15* io.c (rb_io_close_m): Don't raise when the IO object is closed.akr
[ruby-core:67444] [Feature #10718] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-13test_basicsocket.rb: do not hardcode port numbernobu
* test/socket/test_basicsocket.rb (socks): use dynamically chosen port number, and remove never used argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-13* test/socket/test_basicsocket.rb: Remove unused constant.headius
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-13* remove trailing spaces.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-13* test/socket/test_basicsocket.rb: Add basic tests for close_readheadius
and close_write using TCPServer/Socket as a target. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-04test/socket/test_unix.rb (TestSocket_UNIXSocket#test_too_long_path): ↵odaira
sockaddr_un.sun_path in AIX is defined as char[1024], so "a" * 300 is not too long. "a" * 3000 would be enough. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-28Suppress warnings.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-28* ext/socket/unixsocket.c (rsock_init_unixsock): Open a socketakr
after path length check. This fixes a fd leak by TestSocket_UNIXSocket#test_too_long_path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-28test_socket.rb: ignore interface without addressnobu
* test/socket/test_socket.rb (test_udp_server): ignore interface with no address assigned. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-27use Socket.getifaddrs to show interface names and so onnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-24test_udp_server don't test IPv6 link-local addresses.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-18Use Etc.uname instead of uname command invocation.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-21socket: sendmsg/recvmsg only retries blocking on errorsnormal
* ext/socket/ancdata.c (bsock_sendmsg_internal): only retry on error (bsock_recvmsg_internal): ditto * test/socket/test_unix.rb: test above for infinite loop git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-18* test/socket/test_socket.rb: unix socket is required by test case.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-18* test/socket/test_addrinfo.rb: remove unused variables.hsbt
* test/socket/test_nonblock.rb: ditto. * test/socket/test_socket.rb: ditto. * test/socket/test_unix.rb: ditto. * test/testunit/test_parallel.rb: ditto. * test/webrick/test_filehandler.rb: ditto. * test/xmlrpc/test_features.rb: ditto. * test/zlib/test_zlib.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-20* ext/socket/option.c: Use "int" for IP_MULTICAST_LOOP andakr
IP_MULTICAST_TTL on Mac OS X. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-20add a test.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-13* ext/socket/lib/socket.rb: Don't test $! in "ensure" clause becauseakr
it may be set before the body. Reported by ko1 and mrkn. [ruby-core:59088] [Bug #9247] * lib/cgi/core.rb: Ditto. * lib/drb/ssl.rb: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-26* io.c (io_read_nonblock): support non-blocking reads without raisingtenderlove
exceptions. As in: `io.read_nonblock(size, exception: false)` [ruby-core:38666] [Feature #5138] * ext/openssl/ossl_ssl.c (ossl_ssl_read_internal): ditto * ext/stringio/stringio.c (strio_sysread): ditto * io.c (rb_io_write_nonblock): support non-blocking writes without raising an exception. * ext/openssl/ossl_ssl.c (ossl_ssl_write_internal): ditto * test/openssl/test_pair.rb (class OpenSSL): tests * test/ruby/test_io.rb (class TestIO): ditto * test/socket/test_nonblock.rb (class TestSocketNonblock): ditto * test/stringio/test_stringio.rb (class TestStringIO): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-19* test/socket/test_tcp.rb (test_initialize_failure): Use EADDRNOTAVAILakr
to test an error message generated by bind() failure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-05Use server_port for Windowsnaruse
fix r41686 [Bug #8574] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-28* ext/socket/ipsocket.c (init_inetsock_internal): Don't use localakr
addresses which address family is different to remote address. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-26* test/socket/test_udp.rb: Close sockets explicitly.akr
Don't use fixed port number. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-02* test/socket/test_sockopt.rb: change test name. follow r41037.ayumin
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-02follow r41034naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-31* ext/socket/option.c (sockopt_s_byte): constructor of the sockoptnaruse
whose value's is byte. * ext/socket/option.c (sockopt_byte): getter for above. * ext/socket/option.c (inspect_byte): inspect for above. * ext/socket/option.c (sockopt_s_ip_multicast_loop): constructor of the sockopt whose optname is IP_MULTICAST_LOOP. * ext/socket/option.c (sockopt_ip_multicast_loop): getter for above. * ext/socket/option.c (sockopt_s_ip_multicast_ttl): constructor of the sockopt whose optname is IP_MULTICAST_TTL. * ext/socket/option.c (sockopt_ip_multicast_ttl): getter for above. * ext/socket/option.c (sockopt_inspect): use above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-11* ext/socket: New method, Socket.getifaddrs, implemented.akr
[ruby-core:54777] [Feature #8368] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-09* ext/socket/ancdata.c (bsock_sendmsg_internal): Always setakr
controls_num to raise NotImplementedError appropriately. (bsock_recvmsg_internal): Raise NotImplementedError if :scm_rights=>true is given on platforms which don't have 4.4BSD style control message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-08* remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-08Fix #6154 by introducing new EAGAIN/EWOULDBLOCK/EINPROGRESSheadius
subclasses that include WaitReadable or WaitWritable rather than extending them into the exception object each time. * error.c: Capture EGAIN, EWOULDBLOCK, EINPROGRESS exceptions and export them for use in WaitReadable/Writable exceptions. * io.c: Create versions of EAGAIN, EWOULDBLOCK, EINPROGRESS that include WaitReadable and WaitWritable. Add rb_readwrite_sys_fail for nonblocking failures using those exceptions. Use that function in io_getpartial and io_write_nonblock instead of rb_mod_sys_fail * ext/openssl/ossl_ssl.c: Add new SSLError subclasses that include WaitReadable and WaitWritable. Use those classes for write_would_block and read_would_block instead of rb_mod_sys_fail. * ext/socket/ancdata.c: Use rb_readwrite_sys_fail instead of rb_mod_sys_fail in bsock_sendmsg_internal and bsock_recvmsg_internal. * ext/socket/init.c: Use rb_readwrite_sys_fail instead of rb_mod_sys_fail in rsock_s_recvfrom_nonblock and rsock_s_connect_nonblock. * ext/socket/socket.c: Use rb_readwrite_sys_fail instead of rb_mod_sys_fail in sock_connect_nonblock. * include/ruby/ruby.h: Export rb_readwrite_sys_fail for use instead of rb_mod_sys_fail. Introduce new constants RB_IO_WAIT_READABLE and RB_IO_WAIT_WRITABLE for first arg to rb_readwrite_sys_fail. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e