From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 90686 invoked by alias); 12 Apr 2015 08:53:48 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 90673 invoked by uid 89); 12 Apr 2015 08:53:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.1 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: calimero.vinschen.de Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 12 Apr 2015 08:53:45 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 67582A809F2; Sun, 12 Apr 2015 10:53:43 +0200 (CEST) Date: Sun, 12 Apr 2015 08:53:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Executable from x86_64-w64-mingw32-gcc.exe waits for input before prompt in Cygwin terminal but not Win Command Prompt Message-ID: <20150412085343.GO7343@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <29768395.1428797734177.JavaMail.root@mswamui-valley.atl.sa.earthlink.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wA9WyeW1yVBM2Q32" Content-Disposition: inline In-Reply-To: <29768395.1428797734177.JavaMail.root@mswamui-valley.atl.sa.earthlink.net> User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-04/txt/msg00233.txt.bz2 --wA9WyeW1yVBM2Q32 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 799 On Apr 11 20:15, Randy Decker wrote: > # Brief problem description > # C source file - 'printf("Test");' added as diagnostics > # Source compiles and executes in Ubuntu > # Executable compiled in cygwin terminal OK in command prompt W8.1 > # - Also OK in another machine running Windows 8.1 > # Same executable in cygwin term waits for input before usage hint It's a buffering problem. The Cygwin terminal is using a pty which is implemented using Named Pipes for stdio descriptors under the hood. The Windows libraries go into full buffered stdio mode. One workaround is an explicit call to fflush(stdout) before asking for input. Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --wA9WyeW1yVBM2Q32 Content-Type: application/pgp-signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJVKjKXAAoJEPU2Bp2uRE+gMu8P/ApjHyrhTDp7mPyjf1elI0VD +dDCN45kBF9Lyp4TswUag3FZX58WgucoHGa64cn0otWX++qFCH4/w+bysGJLgosx PMmMkQp0gEAmE+EIQAEM+Nu5OYJDA19fEEqR+U6TStvE5mHtbcv7j9ff10RJ/ZS0 OA1orET4dbPxMKjDcmjoLUJAsIj56OzzsAvGenHEKviTfbAqZV174N+TBPOfh9Tf dq5AfHcylKdgvjCgBuZPfo0TEfKKdS3f5o1u4N2T5IGtitwgtrR56OFtfQYnD/5Q iFb7zarOtXNFXg0qkmgWQ9ZaStblsYEtHD1+yULb4gUsc3FvpytbG+e7Lq/0dFoR phg/u+jjGakfSEYkfe2buMWLFYSY9ZMccf/ZlLQWZNRfO/KSs5lhDHOt7MuT+Aw7 n7mQl+/LFewxh/RUagjuW0SmsJJPIq2V46qAI7zORXfJva98M8y7XoBbegaPwQTE wVkvzqHrG08nz3UaCj/rN5tTzwcxVxFyszkZp6ANAcUOL89RpCil2zkHfYL49Voo Sz6cl4tp3k6CnsoJ4x1cjLTu5sq0Pz2/0qxZxvBm9HpaXPzkrW8S7zMRGXzoPZpd qzoh0sKuUBUY7omi9Bq5Tn4Uowt4fCJPfitjInpsspQFS1zwGHFDh6r+9L8Ec4lL 85AAJTrwfC2qamV7qwOj =GrCM -----END PGP SIGNATURE----- --wA9WyeW1yVBM2Q32--