From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 121988 invoked by alias); 17 Jul 2017 17:53:24 -0000 Mailing-List: contact cygwin-apps-help@cygwin.com; run by ezmlm Precedence: bulk Sender: cygwin-apps-owner@cygwin.com List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps@cygwin.com Received: (qmail 120100 invoked by uid 89); 17 Jul 2017 17:53:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,SPF_PASS autolearn=ham version=3.3.2 spammy=pipes, Perl, flushing, Hx-spam-relays-external:ESMTPA X-HELO: vsmx009.vodafonemail.xion.oxcs.net Received: from vsmx009.vodafonemail.xion.oxcs.net (HELO vsmx009.vodafonemail.xion.oxcs.net) (153.92.174.87) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 17 Jul 2017 17:53:20 +0000 Received: from vsmx001.vodafonemail.xion.oxcs.net (unknown [192.168.75.191]) by mta-5-out.mta.xion.oxcs.net (Postfix) with ESMTP id B74AEC0519 for ; Mon, 17 Jul 2017 17:53:18 +0000 (UTC) Received: from Gertrud (p57b9d360.dip0.t-ipconnect.de [87.185.211.96]) by mta-5-out.mta.xion.oxcs.net (Postfix) with ESMTPA id 7EDC130008D for ; Mon, 17 Jul 2017 17:53:16 +0000 (UTC) From: Achim Gratz To: cygwin-apps@cygwin.com Subject: fflush(NULL) clobbers input streams Date: Mon, 17 Jul 2017 17:53:00 -0000 Message-ID: <87k2376jck.fsf@Rainer.invalid> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-VADE-STATUS: LEGIT X-SW-Source: 2017-07/txt/msg00041.txt.bz2 Perl configure for 5.22.1 on Cygwin 2.4.0 said this: --8<---------------cut here---------------start------------->8--- Checking how to flush all pending stdio output... Your fflush(NULL) works okay for output streams. Let's see if it clobbers input pipes... fflush(NULL) seems to behave okay with input streams. --8<---------------cut here---------------end--------------->8--- I'm reasonably certain that the intervening Perl versions were also this way, but I didn't keep the log files around unfortunately. Now, using Cygwin 2.8.x to configure Perl 5.22.4 I got this instead: --8<---------------cut here---------------start------------->8--- Checking how to flush all pending stdio output... Your fflush(NULL) works okay for output streams. Let's see if it clobbers input pipes... Ouch, fflush(NULL) clobbers input pipes! We will not use it. Good, at least fflush(stdin) seems to behave okay when stdin is a pipe. Sigh. Flushing explicitly all the stdio streams doesn't work. --8<---------------cut here---------------end--------------->8--- It seems that fflush is only supposed to discard buffered input data on seekable files, but not pipes (per POSIX.1-2008), so this looks a regression to me. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ Waldorf MIDI Implementation & additional documentation: http://Synth.Stromeko.net/Downloads.html#WaldorfDocs