Hi Raul,
Raul Miller wrote on Wed, Sep 20, 2017 at 06:31:03PM -0400:
> What are the correct cases where write(2) writes 0 bytes and that is
> considered success (as opposed to being one of the documented error
> cases)?
Most importantly, nbytes == 0.
On OpenBSD, we are not aware of any other
On Wed, Sep 20, 2017 at 5:52 PM, Marc Espie wrote:
> On Wed, Sep 20, 2017 at 09:21:53PM +0200, Ingo Schwarze wrote:
>> So, apart from being safer for weird devices on weird implementations,
>> POSIX clearly recommends the idiom for symmetry with read(2) and
>> for compatibility
On Wed, Sep 20, 2017 at 09:21:53PM +0200, Ingo Schwarze wrote:
> So, apart from being safer for weird devices on weird implementations,
> POSIX clearly recommends the idiom for symmetry with read(2) and
> for compatibility with some historic implementations - even though
> the importance of these
Hi,
Todd C. Miller wrote on Mon, Sep 18, 2017 at 09:35:45AM -0600:
> On Mon, 18 Sep 2017 16:50:41 +0200, Ingo Schwarze wrote:
>> Indeed, the above code is nonsensical.
>> It will write the same bytes repeatedly in case of partial writes.
> OK millert@
Committed, thanks for checking.
> That
On Mon, 18 Sep 2017 16:50:41 +0200, Ingo Schwarze wrote:
> Indeed, the above code is nonsensical.
> It will write the same bytes repeatedly in case of partial writes.
OK millert@
That does look much better, though I'm not convinced that write(2)
will ever return 0 unless nbytes is also 0.
On Mon, Sep 18, 2017 at 04:50:41PM +0200, Ingo Schwarze wrote:
> Hi Marc,
>
> Marc Espie wrote on Sun, Sep 17, 2017 at 11:53:39AM +0200:
> > On Sat, Sep 16, 2017 at 10:25:19PM -0500, Scott Cheloha wrote:
>
> >> The second example in the write(2) CAVEATS section is identical to
> >> the
Hi Marc,
Marc Espie wrote on Sun, Sep 17, 2017 at 11:53:39AM +0200:
> On Sat, Sep 16, 2017 at 10:25:19PM -0500, Scott Cheloha wrote:
>> The second example in the write(2) CAVEATS section is identical to
>> the corresponding example in the read(2) page:
>>
>> while ((nr = write(fd, buf,
> On Sep 17, 2017, at 4:53 AM, Marc Espie wrote:
>
> On Sat, Sep 16, 2017 at 10:25:19PM -0500, Scott Cheloha wrote:
>> Hi,
>>
>> [...]
>>
>> --
>> Scott Cheloha
>>
>> Index: lib/libc/sys/write.2
>> ===
>> RCS
On Sat, Sep 16, 2017 at 10:25:19PM -0500, Scott Cheloha wrote:
> Hi,
>
> The second example in the write(2) CAVEATS section is identical to
> the corresponding example in the read(2) page:
>
> while ((nr = write(fd, buf, sizeof(buf))) != -1 && nr != 0)
>
> read(2) returns 0 on EOF, but
Hi,
The second example in the write(2) CAVEATS section is identical to
the corresponding example in the read(2) page:
while ((nr = write(fd, buf, sizeof(buf))) != -1 && nr != 0)
read(2) returns 0 on EOF, but that logic is inapplicable to write(2).
I'm not totally sure what the correct
10 matches
Mail list logo