This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug stdio/10108] setvbuf _IOFBF doesn't honor size correctly


https://sourceware.org/bugzilla/show_bug.cgi?id=10108

paxdiablo <allachan at au1 dot ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |allachan at au1 dot ibm.com

--- Comment #4 from paxdiablo <allachan at au1 dot ibm.com> ---
The _first_ thing you should be doing is checking the return code from
setvbuf(), it's allowed to return a non-zero value if the request cannot be
honoured.

See http://pubs.opengroup.org/onlinepubs/009604499/functions/setvbuf.html for
details.

Hence the line:

    setvbuf (stdout, buf, _IOFBF, size);
should be written as:

    int rc = setvbuf (stdout, buf, _IOFBF, size);
and later on after the sleep(), add

    printf ("setvbuf rc was %d\n", rc);

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]