This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Executable from x86_64-w64-mingw32-gcc.exe waits for input before prompt in Cygwin terminal but not Win Command Prompt


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

Attachment: pgps7kdUHx_ny.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]