RFR: 8292562: (fc) Use copy_file_range in FileChannel::transferTo on Linux [v3]
Brian Burkhalter
bpb at openjdk.org
Mon Aug 22 16:56:18 UTC 2022
On Sat, 20 Aug 2022 15:50:33 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> You are correct: `sendfile` succeeds but `copy_file_range` fails with `EBADF` when the destination is appending. I put in a fix for this in the source not to use `copy_file_range` if the target is open for appending. An alternative would be to just ignore `EBADF` if it occurred.
>>
>> I will add a test next week.
>
>> You are correct: `sendfile` succeeds but `copy_file_range` fails with `EBADF` when the destination is appending. I put in a fix for this in the source not to use `copy_file_range` if the target is open for appending. An alternative would be to just ignore `EBADF` if it occurred.
>>
>> I will add a test next week.
>
> Thanks. The current patch looks okay and I think we can wrap this up once there is a test that exercises transferTo with the destination opened for append.
Actually I was mistaken: `sendfile` fails with `EINVAL` when the destination is appending. I updated the code and will next create a test.
-------------
PR: https://git.openjdk.org/jdk/pull/9925
More information about the nio-dev
mailing list