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:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=fMMzw6SX6WUzyt6+lN/3CmDDYEFsjKlOULSiy5QeIf8adyuw25wkT irOVIpcWgMTLt+/mHBolLbUx0EEtPbQAeIG9E9tCcfkc7SIxIYaxahOOvI4noR+g jGdCVnOFnT3DyodcbPlbYs3UxfakbYuL3Qx79cCxWXqZWxxMqy7fJ4= 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:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=+uyHAmSlR/3Hf6MO5p6zueSHf4Y=; b=u9nVjxC8vQJuejYRN7lPU2W/2gVI rW7V5QtdE1lq1Lz0qwl53FAXFYAWxNMrnsTUuHZyvYYMcc++CL/dB0ijW0dt73Yd ACXDSPJXJbSnboEXfFeRJk0FHfzaKfxzxbLhp3KstrNWtJfmYJ9sfX9FyYH5vGvd i+ONACapeYhYIjI= 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=-4.1 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: calimero.vinschen.de Date: Sun, 12 Apr 2015 10:53:43 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT 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 AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <29768395 DOT 1428797734177 DOT JavaMail DOT root AT mswamui-valley DOT atl DOT sa DOT earthlink DOT 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) --wA9WyeW1yVBM2Q32 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 -----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--