This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug stdio/10108] setvbuf _IOFBF doesn't honor size correctly
- From: "allachan at au1 dot ibm.com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Fri, 31 Jan 2014 04:48:53 +0000
- Subject: [Bug stdio/10108] setvbuf _IOFBF doesn't honor size correctly
- Auto-submitted: auto-generated
- References: <bug-10108-131 at http dot sourceware dot org/bugzilla/>
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.