Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 Message-ID: <413DBF55.3050909@kmweg.de> Date: Tue, 07 Sep 2004 16:01:57 +0200 From: Martin Haendler Organization: Krauss-Maffei Wegmann GmbH & Co. KG User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040114 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Ada: Text_Io.Get_Immediate() is blocking Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 07 Sep 2004 14:00:53.0326 (UTC) FILETIME=[16BE16E0:01C494E3] X-IsSubscribed: yes Hi, I'm working with ADA and Windows2000/Cygwin. A call to Text_Io.Get_Immediate() should return even if there is no input waiting. I have no problems with Linux, but trying to shift Software to Windows brings me into trouble: If there is no input waiting, the call is blocking. Here is a simple example: (Save it as "keyboardtest.adb" and call "gnatmake keyboardtest".) =================================================== with Text_Io; procedure Keyboardtest is Char : Character := ' '; Key_Pressed : Boolean := False; begin Text_Io.Get_Immediate(Char, Key_Pressed); if Key_Pressed then Text_Io.Put_Line("[" & Char & "]"); end if; end Keyboardtest; =================================================== With Linux (gcc version 3.2.3, GNAT Pro 5.02a) this program terminates immediately which is the correct behaviour. With Win2000/Cygwin it waits until a key is pressed, prints out the key and then terminates. "gcc -v" says: Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/specs Configured with: /GCC/gcc-3.3.1-3/configure --with-gcc --with-gnu-ld --with-gnu-as --prefix=/usr --exec-prefix=/u sr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/sbin --mandir=/usr/share/man --infodir=/usr/share/info - -enable-languages=c,ada,c++,f77,pascal,java,objc --enable-libgcj --enable-threads=posix --with-system-zlib --enab le-nls --without-included-gettext --enable-interpreter --enable-sjlj-exceptions --disable-version-specific-runtim e-libs --enable-shared --disable-win32-registry --enable-java-gc=boehm --disable-hash-synchronization --verbose - -target=i686-pc-cygwin --host=i686-pc-cygwin --build=i686-pc-cygwin Thread model: posix gcc version 3.3.1 (cygming special) "gnat" says: GNAT 3.3.1 (cygming special) Copyright 1996-2002 Free Software Foundation, Inc. Do you know any solution or workaround? Thank you!!! Martin -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/