This is the mail archive of the
mailing list for the Cygwin project.
Re: connect() not interrupted by sigalrm?
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 24 Feb 2003 22:42:14 +0100
- Subject: Re: connect() not interrupted by sigalrm?
- References: <200302241757.h1OHvQN16044@head-cfa.cfa.harvard.edu>
- Reply-to: cygwin at cygwin dot com
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
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