diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-12 02:24:51 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-12 02:24:51 +0000 |
commit | 7e2f0491ce16d7f15660b0b01be9f23526aa07b9 (patch) | |
tree | a6098c5ee9f68e0ad895fc71a666dcecb5da189d /test | |
parent | fc7bb927a24ffe60c89f70a00bcc9bbab73ecff6 (diff) | |
download | ruby-7e2f0491ce16d7f15660b0b01be9f23526aa07b9.tar.gz |
* io.c (ioctl_req_t): Type of req argument of ioctl() depend on platform.
Moreover almost all linux ioctl can't be represented by 32bit integer
(i.e. MSB is 1). We need wrap ioctl argument type.
[Bug #5429] [ruby-dev:44589]
* io.c (struct ioctl_arg): ditto.
* io.c (rb_ioctl): ditto.
* test/ruby/test_io.rb (test_ioctl_linux): add a testcase for ioctl
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_io.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index e4af5e0e9f..f7670a1293 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -2055,4 +2055,16 @@ End assert(w.close_on_exec?) } end + + def test_ioctl_linux + return if /linux/ !~ RUBY_PLATFORM + + assert_nothing_raised do + File.open('/dev/urandom'){|f1| + entropy_count = "" + # get entropy count + f1.ioctl(0x80045200, entropy_count) + } + end + end end |