RFR: 8274548: (fc) FileChannel gathering write fails with IOException "Invalid argument" on macOS 11.6 [v6]

Alan Bateman alanb at openjdk.java.net
Sat Oct 9 07:21:10 UTC 2021


On Fri, 8 Oct 2021 21:11:36 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> On macOS, handle the case where `writev()` is given an array of `struct iovec` the sum of whose `iov_len` fields overflows `INT_MAX`.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8274548: Minor restructuring of get_darwin_version() and writevMax()

src/java.base/unix/native/libnio/ch/IOUtil.c line 216:

> 214:     //          overflows a 32-bit integer.
> 215:     //
> 216:     int darwin_version = get_darwin_version();

What you would think about dropping the OS version and just return Integer.MAX_VALUE on macOS? That would align with the EINVAL documented in the man page on all versions.

In passing, an inconsistency has kept into the native code. In some places we are using ifdef __APPLE__ and in others ifdef MACOX. We should probably clean this up.

-------------

PR: https://git.openjdk.java.net/jdk/pull/5831


More information about the nio-dev mailing list