X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:subject:mime-version:content-type :content-transfer-encoding:date:from:message-id; q=dns; s= default; b=csFohLlPaRIjMx+Atxcy4eDIWehmtySezHzos78KVdJ4Wmr4DWAnG HV2IFvbFaFkuYpSjjePTChzN0GFvTK2Vn39rVPo6r3oDRfEQfyXN1nSRivhWvF4A ytsct7ik8MMVpZ94bKWloSB9ndWs3j7qmiLZFwBl9XxQfJ3HDxgmBI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:subject:mime-version:content-type :content-transfer-encoding:date:from:message-id; s=default; bh=U jx4KGnD8h1qBdVo6UxfzHwTiGk=; b=O20ORaOlRmADx5tAEyG6HtkDW0uUEE7cc uN9Fk5VO2egH1PU37Ew8IeSQm7JL1sP+EwAEQFGvqhYWDRzFPbOjYDZWuoB3uCqb TIaqu+WdAVIk/m9NUpmJuUwtUKmVmizincyOHn0GIuG6z7q3KyslP9BvekIIl0FH WJdRJwXo2U= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.8 required=5.0 tests=BAYES_50,FROM_STARTS_WITH_NUMS,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Mac, buffering, HX-PHP-Originating-Script:501, stdio X-HELO: smtp-out-so.shaw.ca X-Authority-Analysis: v=2.1 cv=VIR9547X c=1 sm=1 tr=0 a=WiYoHcCliNeVponEdG0Ckg==:117 a=WiYoHcCliNeVponEdG0Ckg==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=IkcTkHD0fZMA:10 a=SMorJkV_YP8A:10 a=7OsogOcEt9IA:10 a=uPZiAMpXAAAA:8 a=2KUf1mbJAAAA:8 a=TKfZGsrgrFnpe2WQR6cA:9 a=QEXdDO2ut3YA:10 To: cygwin AT cygwin DOT com Subject: Problem with line buffering and getc function on 1.7.33. X-PHP-Originating-Script: 501:rcmail.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Date: Fri, 11 Mar 2016 11:16:52 -0800 From: Kaz Kylheku <920-082-4242 AT kylheku DOT com> Message-ID: X-Sender: 920-082-4242 AT kylheku DOT com User-Agent: Roundcube Webmail/0.9.2 X-CMAE-Envelope: MS4wfHoUPYWa01kgU6GvOuWcCxeF0GA9BJliomskogeoOY0bmWI1935yhNhalqNl+nnrTZb5b6OCKqRFhrWB9dxmaDOujAzv2LYkaWUyMYy+9MzxSHe8uUim /iLCd9iDolAiC1Aos549iy3rPg11J8BW7YpOccVERAKdHXXshc79fz+D X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id u2BJHKJa023821 Hi all, On a Cygwin installation version 1.7.33-2(0.280/5/3), I encountered an odd issue. I wrote it up in a StackOverflow question: http://stackoverflow.com/questions/35928828/cygwin-missing-stream-data-due-to-stdio-putc-line-buffering 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 socket 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 containing the character to be output), then things work as expected. Here is a patch I put into the real program where this issue was found: http://www.kylheku.com/cgit/txr/commit/?id=3c5f110cc29f8d3fbf2069c68d25ccebee46679e 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 FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple