Skip to content

fast_io.rs: use sendfile or splice if copy_file_range is not supported#459

Open
Franklin-Qi wants to merge 1 commit into
uutils:mainfrom
Franklin-Qi:fix-#443-use-sendfile-or-splice-if-copy-file-range-is-not-supported
Open

fast_io.rs: use sendfile or splice if copy_file_range is not supported#459
Franklin-Qi wants to merge 1 commit into
uutils:mainfrom
Franklin-Qi:fix-#443-use-sendfile-or-splice-if-copy-file-range-is-not-supported

Conversation

@Franklin-Qi
Copy link
Copy Markdown

  • Use splice and attempt to expand the pipe size when necessary.
  • Modify the reliable_copy_file_range() function to sequentially attempt copy_file_rangesplicesendfilewrite.
  • Add Linux-based unit tests.

Closes: #443

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 5, 2026

Codecov Report

❌ Patch coverage is 72.41379% with 56 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.85%. Comparing base (a9a332a) to head (581e725).

Files with missing lines Patch % Lines
src/sed/fast_io.rs 72.41% 56 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #459      +/-   ##
==========================================
- Coverage   82.18%   81.85%   -0.33%     
==========================================
  Files          13       13              
  Lines        5551     5743     +192     
  Branches      312      323      +11     
==========================================
+ Hits         4562     4701     +139     
- Misses        986     1039      +53     
  Partials        3        3              
Flag Coverage Δ
macos_latest 82.86% <ø> (ø)
ubuntu_latest 82.61% <72.41%> (-0.36%) ⬇️
windows_latest 0.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Use `splice` and attempt to expand the pipe size when necessary.
- Modify the `reliable_copy_file_range()` function to sequentially attempt `copy_file_range` → `splice` → `sendfile` → `write`.
- Add Linux-based unit tests.

Closes: uutils#443
@Franklin-Qi Franklin-Qi force-pushed the fix-#443-use-sendfile-or-splice-if-copy-file-range-is-not-supported branch from cee18ce to 581e725 Compare June 5, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fast_io.rs: use sendfile or splice if copy_file_range is not supported

1 participant