Re: Using alarm() to break out of socket accept

From: Alan Cox (alan@lxorguk.ukuu.org.uk)
Date: Wed Mar 15 2000 - 06:47:38 EST


> We have code that uses an alarm() to routinely break ouf of a socket accept
> and then perform some processing (check a flag) and then loop back around
> to wait for a connection again. The code works fine on Solaris, HP-UX,,
> AIX, and other flavours but not on RedHat 6.0.

Ugly way to do it (non blocking connect and select() is cleaner)

> I noticed that by default, SIGALRM is ignored so I unblocked it with
> sigprocmask but we are still not getting the behaviour we require.
> Is there something I am missing here?

Are you using sigaction to force the signal to interrupt connect and not
be restartable ?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Mar 15 2000 - 21:00:30 EST