io-wait 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/ext/io/wait/extconf.rb +1 -0
- data/ext/io/wait/wait.c +9 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab2e90fe2ac7d5df2d629e3ccd501b8c01570fadd3eeee5d42709e55deb26ec6
|
4
|
+
data.tar.gz: 12663accc0c74fb25368e47a87fbc7a5b4f06ccd7435ee1ab4528e51b4dca843
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bc887d4119a7c39978294b99d6bc2affbc0124236ec4062fe439ffbfa64db295ec4de180a1db16ad2c481927a72f046def66e34dae9cca49157ccd25a8b82e4
|
7
|
+
data.tar.gz: 1b237ca1a3f74ff1208059f49061df665ff4a78f8da89d9b7ffbb9a57cd9205ffbb848fb583704fafad66954df7f2481d9a145e1d68591c31d11ab8fff1b2dbe
|
data/Gemfile
CHANGED
data/ext/io/wait/extconf.rb
CHANGED
@@ -6,6 +6,7 @@ if RUBY_VERSION < "2.6"
|
|
6
6
|
else
|
7
7
|
target = "io/wait"
|
8
8
|
have_func("rb_io_wait")
|
9
|
+
have_func("rb_io_descriptor")
|
9
10
|
unless macro_defined?("DOSISH", "#include <ruby.h>")
|
10
11
|
have_header(ioctl_h = "sys/ioctl.h") or ioctl_h = nil
|
11
12
|
fionread = %w[sys/ioctl.h sys/filio.h sys/socket.h].find do |h|
|
data/ext/io/wait/wait.c
CHANGED
@@ -87,8 +87,15 @@ io_nread(VALUE io)
|
|
87
87
|
rb_io_check_readable(fptr);
|
88
88
|
len = rb_io_read_pending(fptr);
|
89
89
|
if (len > 0) return INT2FIX(len);
|
90
|
-
|
91
|
-
|
90
|
+
|
91
|
+
#ifdef HAVE_RB_IO_DESCRIPTOR
|
92
|
+
int fd = rb_io_descriptor(io);
|
93
|
+
#else
|
94
|
+
int fd = fptr->fd;
|
95
|
+
#endif
|
96
|
+
|
97
|
+
if (!FIONREAD_POSSIBLE_P(fd)) return INT2FIX(0);
|
98
|
+
if (ioctl(fd, FIONREAD, &n)) return INT2FIX(0);
|
92
99
|
if (n > 0) return ioctl_arg2num(n);
|
93
100
|
return INT2FIX(0);
|
94
101
|
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: io-wait
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nobu Nakada
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-12-13 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Waits until IO is readable or writable without blocking.
|
15
15
|
email:
|
@@ -48,7 +48,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: '0'
|
50
50
|
requirements: []
|
51
|
-
rubygems_version: 3.
|
51
|
+
rubygems_version: 3.5.0.dev
|
52
52
|
signing_key:
|
53
53
|
specification_version: 4
|
54
54
|
summary: Waits until IO is readable or writable without blocking.
|