www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/04/29/07:28:40

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
Message-ID: <4BD96D59.7080808@gmx.de>
Date: Thu, 29 Apr 2010 13:28:25 +0200
From: Matthias Andree <matthias DOT andree AT gmx DOT de>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.1.9) Gecko/20100317 Lightning/1.0b1 Thunderbird/3.0.4
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: select() hanging after terminal killed
References: <201004291053 DOT o3TAr15g018361 AT mail DOT bln1 DOT bf DOT nsn-intra DOT net>
In-Reply-To: <201004291053.o3TAr15g018361@mail.bln1.bf.nsn-intra.net>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Am 29.04.2010 12:53, schrieb Thomas Wolff:

[on closed terminal]
> On Linux, select() indicates an exception and EIO.
> On SunOS, select() indicates both an exception and input (weird),

Not weird, you appear to be misunderstanding select().
An IEEE Std 1003.1 compliant select():

 - only states that a subsequent read() will *not block*
   this includes EOF and error, as they make read() return without blocking)

 - makes *no statements about success*

> 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.

Pointers for workarounds: alarm(), signal().

-- 
Matthias Andree

--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019