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 To: cygwin AT cygwin DOT com From: "Linux Dr." Subject: Non-blocking keyboard I/O? Date: Mon, 23 Feb 2004 16:44:45 +0000 (UTC) Lines: 17 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet AT sea DOT gmane DOT org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 134.253.26.6 (Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.0.1) Gecko/20020920 Netscape/7.0) I have a non-blocking keyboard I/O routine I've used for years under IRIX, Solaris and Red Hat linux. It doesn't seem to work under cygwin, however. The core of it is: fcntl(0. F__SETFL, fcntl(0, F_GETFL) | O_NONBLOCK) tcgetattr(0, &termios_p); termios_p.c_lflag &= ~(ICANON | ECHO); termios_p.c_lflag &= ~(ICANON); termios_p.c_cc[VMIN] = 1; termios_p.c_cc[VTIME] = 0; tcsetattr(0, TCSANOW, &termios_p); I subsituted FIONBIO for O_NONBLOCK and both complied and ran but both versions still blocked. Is there something obvious I'm doing wrong? Is there an alternative way to do this under cygwin? TIA! Neall -- 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/