gh-154324: Fix os.sendfile() error reporting on illumos - #154327
Conversation
illumos sendfile(3EXT) returns the number of transferred bytes by adding it to the offset without initializing it, so the offset cannot be used to detect a partial write. Use sendfilev(3EXT), which reports the number of transferred bytes in an explicit out parameter. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@kulikjak, could you please look at this and verify if it works on real Solaris? |
|
This one is Illumos specific -
I again tested it with your change on our end, and all tests still pass. I never tried using |
|
I tested At The two parts are complementary: the |
Oracle Solaris is not affected: its sendfile() reports the number of transferred bytes correctly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15. |
|
GH-154832 is a backport of this pull request to the 3.15 branch. |
|
GH-154833 is a backport of this pull request to the 3.14 branch. |
|
GH-154834 is a backport of this pull request to the 3.13 branch. |
…4327) (GH-154834) illumos sendfile(3EXT) returns the number of transferred bytes by adding it to the offset without initializing it, so the offset cannot be used to detect a partial write. Use sendfilev(3EXT), which reports the number of transferred bytes in an explicit out parameter. (cherry picked from commit e3634bb) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…4327) (GH-154833) illumos sendfile(3EXT) returns the number of transferred bytes by adding it to the offset without initializing it, so the offset cannot be used to detect a partial write. Use sendfilev(3EXT), which reports the number of transferred bytes in an explicit out parameter. (cherry picked from commit e3634bb) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…4327) (GH-154832) illumos sendfile(3EXT) returns the number of transferred bytes by adding it to the offset without initializing it, so the offset cannot be used to detect a partial write. Use sendfilev(3EXT), which reports the number of transferred bytes in an explicit out parameter. (cherry picked from commit e3634bb) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
illumos
sendfile(3EXT)returns the number of transferred bytes by adding it to*offwithout initializing it, so the offset cannot be used to detect a partial write when the call fails before writing any data, and errors were reported as successful transfers.Use
sendfilev(3EXT)instead, which reports the number of transferred bytes in an explicit out parameter.