Proposal Details
Writing to a file from an io.SectionReader backed by a file could
use copy_file_range(2).
The machinery for this mostly exists: SectionReader.Outer() gives
access to the underlying *os.File and offset. Then, the offset
should be passed into unix.CopyFileRange. After the call completes,
the number of bytes (or the updated offset) can be passed to
SectionReader.Seek.
The only missing piece is that CopyFileRange in internal/poll
does not accept offset arguments. Is this something that can be
changed, and if yes, does it require a formal proposal?
For reference, this is similar to
#61727.
Proposal Details
Writing to a file from an
io.SectionReaderbacked by a file coulduse
copy_file_range(2).The machinery for this mostly exists:
SectionReader.Outer()givesaccess to the underlying
*os.Fileand offset. Then, the offsetshould be passed into
unix.CopyFileRange. After the call completes,the number of bytes (or the updated offset) can be passed to
SectionReader.Seek.The only missing piece is that
CopyFileRangeininternal/polldoes not accept offset arguments. Is this something that can be
changed, and if yes, does it require a formal proposal?
For reference, this is similar to
#61727.