Re: partial failures in write(2) (and read(2))

2021-02-05 Thread Greg Troxel
David Holland writes: > Basically, it is not feasible to check for and report all possible > errors ahead of time, nor in general is it possible or even desirable > to unwind portions of a write that have already been completed, which > means that if a failure occurs partway through a write

Re: partial failures in write(2) (and read(2))

2021-02-05 Thread Mouse
> It is possible for write() calls to fail partway through, after > already having written some data. It is. As you note later, it's also possible for read(). The rightest thing to do, it seems to me, would be to return the error indication along with how much was successfully written (or

partial failures in write(2) (and read(2))

2021-02-05 Thread David Holland
(This came up in chat, and since there was no agreement at all there it seems it ought to be discussed here.) It is possible for write() calls to fail partway through, after already having written some data. We do not currently document the behavior under these circumstances (though we should),