This is the mail archive of the
mailing list for the Cygwin project.
Re: connect() not interrupted by sigalrm?
- 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 harvard dot edu>
- Date: Mon, 24 Feb 2003 19:05:30 -0000
- Subject: Re: connect() not interrupted by sigalrm?
- References: <200302241846.h1OIkcN18248@head-cfa.cfa.harvard.edu>
> 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 (?).
elfyn at exposure dot org dot uk
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html