delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/02/24/14:05:14

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Message-ID: <035601c2dc37$dd623cb0$c67486d9@webdev>
From: "Elfyn McBratney" <elfyn-cygwin AT exposure DOT org DOT uk>
To: "cygwin" <cygwin AT cygwin DOT com>,
"Eric Mandel" <eric AT head-cfa DOT cfa DOT harvard DOT edu>
References: <200302241846 DOT h1OIkcN18248 AT head-cfa DOT cfa DOT harvard DOT edu>
Subject: Re: connect() not interrupted by sigalrm?
Date: Mon, 24 Feb 2003 19:05:30 -0000
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106

> Thanks for your prompt response:
>
> > Cockpit error. You left out a few headers.
> > - string.h is needed for memset()
> > - unistd.h is needed for alarm()
> > - arpa/inet.h is needed for inet_addr()
> >
> > After that it works fine.
>
> The addition of these include files does make gcc -Wall happier, but
> it not change the behavior of the program at run-time. Under Cygwin on
> my XP box, it still waits many seconds for the connect() to timeout
> and then returns with a "Connection timed out" error, instead of
> returning after the 2 second alarm with the desired "Interrupted
> system call" error.

I believe I have found the problem. In order for your program to work as
expected you will need SA_INTERRUPT , which is not defined in
/usr/include/sys/signal.h . So it just laggs until it gets to the "Network
unreachable" error. I'm not to sure the reason why it's not there (?).


Regards,

Elfyn McBratney
elfyn AT exposure DOT org DOT uk
www.exposure.org.uk



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

- Raw text -


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