From: "javanthropus (Jeremy Bopp)" Date: 2022-09-04T23:13:33+00:00 Subject: [ruby-core:109843] [Ruby master Bug#18880] IO#sysread on Windows does not validate arguments Issue #18880 has been updated by javanthropus (Jeremy Bopp). I'm interested in submitting a patch for this, but which behavior is considered correct? ---------------------------------------- Bug #18880: IO#sysread on Windows does not validate arguments https://bugs.ruby-lang.org/issues/18880#change-99080 * Author: javanthropus (Jeremy Bopp) * Status: Open * Priority: Normal * ruby -v: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x64-mingw-ucrt] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- When passing an invalid number of bytes to read, such as `-1` , to `IO#sysread` on Linux, an `ArgumentError` is raised. On Windows `Errno::EINVAL` is raised instead. ``` ruby r, w = IO.pipe r.sysread(-1) ``` This raises `ArgumentError` on non-Windows and `Errno::EINVAL` on Windows. -- https://bugs.ruby-lang.org/ Unsubscribe: