gh-154324: Fix os.sendfile() error reporting on illumos#154327
gh-154324: Fix os.sendfile() error reporting on illumos#154327serhiy-storchaka wants to merge 2 commits into
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>
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.