Executable from x86_64-w64-mingw32-gcc.exe waits for input before prompt in Cygwin terminal but not Win Command Prompt
Corinna Vinschen
corinna-cygwin@cygwin.com
Sun Apr 12 08:53:00 GMT 2015
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
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20150412/d3de7cdc/attachment.sig>
More information about the Cygwin
mailing list