This is the mail archive of the
mailing list for the Cygwin project.
Problem with line buffering and getc function on 1.7.33.
- From: Kaz Kylheku <920-082-4242 at kylheku dot com>
- To: cygwin at cygwin dot com
- Date: Fri, 11 Mar 2016 11:16:52 -0800
- Subject: Problem with line buffering and getc function on 1.7.33.
- Authentication-results: sourceware.org; auth=none
On a Cygwin installation version 1.7.33-2(0.280/5/3), I encountered an
I wrote it up in a StackOverflow question:
This contains a repro test case.
For the benefit of non-users of WWW, the summary is this:
I'm sending data to a stdio stream which has been fdopen-ed from a
descriptor (which could be irrelevant). The stream is put into line
buffered mode with setvbuf. When the getc function is used to perform
output on this stream, it loses data. When the string "REPLY\n" is sent,
character by character, the receiver receives only "\n".
If line buffering is not employed, or of putc(ch, stream) is replaced
by fputs(str, stream) (where str is a one-character-long string
the character to be output), then things work as expected.
Here is a patch I put into the real program where this issue was
with the patch, TXR's socket test cases pass on Cygwin.
The tests pass on Solaris 10, various GNU/Linuxes and Mac OS 10.7.3.
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple