Skip to content

cat: improve fallback when splice failed, dedup a code#11796

Open
oech3 wants to merge 1 commit intouutils:mainfrom
oech3:drain
Open

cat: improve fallback when splice failed, dedup a code#11796
oech3 wants to merge 1 commit intouutils:mainfrom
oech3:drain

Conversation

@oech3
Copy link
Copy Markdown
Contributor

@oech3 oech3 commented Apr 13, 2026

  • dedup a code with buf_copy
  • drop BUF_SIZE
  • use same buf size with pipe at write fallback when splice from broker pipe failed. (this failure would not happen generally. So using 1 MiB should not be problem)
  • directly use rustix::io to make its meaning clear (raw syscall usage)
  • remove assertion from release binary

@oech3 oech3 force-pushed the drain branch 2 times, most recently from 74c7a47 to 0b2ba2d Compare April 13, 2026 18:41
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 13, 2026

GNU testsuite comparison:

Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/cp/link-heap is now being skipped but was previously passing.
Congrats! The gnu test tests/expand/bounded-memory is now passing!

@oech3 oech3 marked this pull request as ready for review April 13, 2026 19:02
@oech3
Copy link
Copy Markdown
Contributor Author

oech3 commented Apr 14, 2026

duplicated code?

/// Move exactly `num_bytes` bytes from `read_fd` to `write_fd` using the `read`

@oech3 oech3 changed the title cat: improve fallback when splice failed cat: improve fallback when splice failed, dedup a code Apr 14, 2026
@oech3 oech3 force-pushed the drain branch 8 times, most recently from cb5d31c to 4c1fedc Compare April 14, 2026 03:44
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.

2 participants