X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=0.8 required=5.0 tests=BAYES_50 X-Spam-Check-By: sourceware.org Date: Thu, 29 Apr 2010 12:53:01 +0200 (CEST) Message-Id: <201004291053.o3TAr15g018361@mail.bln1.bf.nsn-intra.net> To: cygwin AT cygwin DOT com From: Thomas Wolff Subject: select() hanging after terminal killed X-IsSubscribed: yes 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 If a terminal gets killed, its tty/pty is not properly closed. This is likely to confuse applications and let them hang, as observed with mined (thanks Andy for the report) and joe. On Linux and SunOS, a subsequent read() return 0 (indicating EOF); any further read() returns -1, errno indicating EIO. Immediate write() may report success a few times, further write() returns -1, errno indicating EIO. On Linux, select() indicates an exception and EIO. On SunOS, select() indicates both an exception and input (weird), and ENOENT initially, EIO on further attempts. On Cygwin, the following is observed: * EOF is not signalled on read(); rather EIO is indicated right away. (Maybe not too bad, an application can handle that as well.) * select() with timeout hangs. Especially the latter can hardly be handled by an application. ------ Thomas -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple