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 Date: Mon, 24 Feb 2003 22:42:14 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: connect() not interrupted by sigalrm? Message-ID: <20030224214214.GF1677@cygbert.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <200302241757 DOT h1OHvQN16044 AT head-cfa DOT cfa DOT harvard DOT edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200302241757.h1OHvQN16044@head-cfa.cfa.harvard.edu> User-Agent: Mutt/1.4i On Mon, Feb 24, 2003 at 12:57:26PM -0500, Eric Mandel wrote: > > Cygwin version: 1.3.20-1 > Win OS tested: NT 4.0/SP6 and XP > > I have an application that calls alarm() before connect() in order to > prevent connect() from hanging if the host is down or non-existent. > When alarm() goes off, it sends the SIGALRM signal, which interrupts > the connect() system call. This works under Linux, Solaris, OSF, and > Mac OS X, but apparently not under Cygwin. As shown in the appended > code, the alarm does go off and can trigger an associated alarm > function, but the connect() system call is not interrupted. The Cygwin connect() call isn't interruptible so far. It's still implemented by just calling the WinSock connect() plus some magical hocus-pocus afterwards. It's possible to change it to an interruptible call but that requires some coding. In the meantime, how about using a non-blocking connect() and a call to select() instead? Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Developer mailto:cygwin AT cygwin DOT com Red Hat, Inc. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/