Merge the changes for #188 and #191 which add an intermediate pipe on the input side to allow splice() to be used for all transfers.

This commit is contained in:
Andrew Wood
2026-05-03 17:59:13 +01:00
12 changed files with 287 additions and 23 deletions
+12 -5
View File
@@ -291,6 +291,14 @@ automatically switches on \*(lq\fB\-\-no\-splice\fR\*(rq.
Switching on this option results in a small loss of transfer efficiency.
It has no effect on systems where \fBsplice\fR(2) is unavailable.
.TP
.BI \-J\ BYTES \fR,\ \fB\-\-pipe\-buffer\-size\ BYTES
Attempt to set the size of the output pipe buffer to \fIBYTES\fR bytes.
This will only have an effect if the output is a pipe, and will silently do
nothing if the requested size cannot be achieved.
If this option is not specified, and both the output and the first input are
pipes, then the output pipe buffer size will automatically be increased to
match the input pipe buffer, if it was smaller.
.TP
.B \-E, \-\-skip-errors
Ignore read errors by attempting to skip past the offending sections.
The corresponding parts of the output will be null bytes.
@@ -348,7 +356,6 @@ seekable, this option will have no effect other than to turn on
Instead of transferring input data to standard output, discard it.
This is equivalent to redirecting standard output to \fI/dev/null\fR,
except that \fBwrite\fR(2) is never called.
Implies \*(lq\fB\-\-no\-splice\fR\*(rq.
.TP
.BI \-U\ FILE \fR,\ \fB\-\-store\-and\-forward\ FILE
Instead of passing data through immediately, do it in two stages - first
@@ -857,10 +864,10 @@ effective with small input files, and \*(lq\fB%nL\fR\*(rq may be a few lines
out due to buffering within the pipeline itself.
.PP
Numbers passed to \*(lq\fB\-\-size\fR\*(rq, \*(lq\fB\-\-rate\-limit\fR\*(rq,
\*(lq\fB\-\-buffer\-size\fR\*(rq, and \*(lq\fB\-\-error\-skip\-block\fR\*(rq
may all be expressed as decimals if followed by a suffix, so for example
\*(lq\fI\-\-size\~1.5G\fR\*(rq is equivalent to
\*(lq\fI\-\-size\~1536M\fR\*(rq.
\*(lq\fB\-\-buffer\-size\fR\*(rq, \*(lq\fB\-\-pipe\-buffer\-size\fR\*(rq,
and \*(lq\fB\-\-error\-skip\-block\fR\*(rq may all be expressed as decimals
if followed by a suffix, so for example \*(lq\fI\-\-size\~1.5G\fR\*(rq is
equivalent to \*(lq\fI\-\-size\~1536M\fR\*(rq.
.PP
Numbers passed to \*(lq\fB\-\-interval\fR\*(rq and
\*(lq\fB\-\-delay\-start\fR\*(rq may be integers or decimals, but may not
+14 -5
View File
@@ -300,6 +300,15 @@ are explicitly switched on will be shown.
option results in a small loss of transfer efficiency. It has no
effect on systems where **splice**(2) is unavailable.
**-J BYTES, \--pipe-buffer-size BYTES**
: Attempt to set the size of the output pipe buffer to *BYTES* bytes.
This will only have an effect if the output is a pipe, and will
silently do nothing if the requested size cannot be achieved. If
this option is not specified, and both the output and the first
input are pipes, then the output pipe buffer size will automatically
be increased to match the input pipe buffer, if it was smaller.
**-E, \--skip-errors**
: Ignore read errors by attempting to skip past the offending
@@ -360,8 +369,7 @@ are explicitly switched on will be shown.
: Instead of transferring input data to standard output, discard it.
This is equivalent to redirecting standard output to */dev/null*,
except that **write**(2) is never called. Implies
"**\--no-splice**".
except that **write**(2) is never called.
**-U FILE, \--store-and-forward FILE**
@@ -814,9 +822,10 @@ small input files, and "**%nL**" may be a few lines out due to buffering
within the pipeline itself.
Numbers passed to "**\--size**", "**\--rate-limit**",
"**\--buffer-size**", and "**\--error-skip-block**" may all be expressed
as decimals if followed by a suffix, so for example "*\--size 1.5G*" is
equivalent to "*\--size 1536M*".
"**\--buffer-size**", "**\--pipe-buffer-size**", and
"**\--error-skip-block**" may all be expressed as decimals if followed
by a suffix, so for example "*\--size 1.5G*" is equivalent to
"*\--size 1536M*".
Numbers passed to "**\--interval**" and "**\--delay-start**" may be
integers or decimals, but may not have a suffix.