[jdk17] RFR: 8269074: (fs) Files.copy fails to copy from /proc on some linux kernel versions
Brian Burkhalter
bpb at openjdk.java.net
Thu Jun 24 23:21:09 UTC 2021
On Thu, 24 Jun 2021 04:17:56 GMT, Vyom Tewari <vtewari at openjdk.org> wrote:
>> On Linux, if while executing `java.nio.file.Files.copy(Path,Path,CopyOption...)` the native function `sendfile(2)` fails with `EINVAL`, fall back to transferring via user-space buffers.
>
> src/java.base/unix/native/libnio/fs/UnixCopyFile.c line 123:
>
>> 121: RESTARTABLE(sendfile64(dst, src, NULL, count), bytes_sent);
>> 122: if (bytes_sent == -1) {
>> 123: if (errno == EINVAL) {
>
> Don't you think we have have to take care of "ENOSYS" as well. Manual pages talks about "ENOSYS" as well.
>
> "Applications may wish to fall back to read(2)/write(2) in the case where sendfile() fails with EINVAL or ENOSYS."
I think that's a good point.
-------------
PR: https://git.openjdk.java.net/jdk17/pull/128
More information about the nio-dev
mailing list