Ping[3]: [PATCH][BZ #11741] printf should return negative value on I/O error

Carlos O'Donell carlos@systemhalted.org
Fri Nov 16 05:21:00 GMT 2012


On Fri, Nov 16, 2012 at 12:17 AM, Siddhesh Poyarekar
<siddhesh@redhat.com> wrote:
> On Thu, 15 Nov 2012 23:58:30 -0500, Carlos wrote:
>> I expect xsputn to return the number of bytes written, including 0,
>> and never EOF, since that is what ISO C++ says.
>>
>> If we aren't going to follow exactly what xsputn does in C++ then we
>> should add a very large warning about this.
>
> vfprintf currently needs the EOF to determine if an error had
> occurred.  libstdc++ does not use libio any more, so glibc is the only
> user here.  Do we still need to retain the C++ semantics?

Thanks for digging into the details here.

No, we don't need to retain the C++ semantics, but we need to adjust
the comments in the libio headers to mention this and comment on the
differences between ISO C++ and what we have implemented here.

Cheers,
Carlos.



More information about the Libc-alpha mailing list