[PATCH v2 2/2] libstdc++: use copy_file_range, improve sendfile in filesystem::copy_file

2023-03-15 Thread Jannik Glückert via Gcc-patches
From c028a0072c7573cfac90289b3606ba19cb8272a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannik=20Gl=C3=BCckert?= Date: Wed, 8 Mar 2023 19:37:43 +0100 Subject: [PATCH 2/2] libstdc++: use copy_file_range MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit copy_

[PATCH v2 1/2] libstdc++: use copy_file_range, improve sendfile in filesystem::copy_file

2023-03-15 Thread Jannik Glückert via Gcc-patches
This iteration improves error handling for copy_file_range, particularly around undocumented error codes in earlier kernel versions. Additionally this fixes the userspace copy fallback to handle zero-length files such as in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108178. Lastly, the case "src

[PATCH] libstdc++: use copy_file_range, improve sendfile in filesystem::copy_file

2023-03-06 Thread Jannik Glückert via Gcc-patches
The current copy_file implementation is suboptimal. It only uses sendfile for files smaller than 2GB, falling back to a userspace copy, and does not support copy_file_range at all. copy_file_range is particularly of increasing importance with the adoption of reflinks in filesystems. I am pretty su