You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rasmus Lerdorf <ra...@lerdorf.on.ca> on 1997/11/22 13:51:30 UTC

SIGALRM usage in modules?

I have been trying to sort through the code to figure out whether setting
an alarm in a module will interfere with Apache's alarm handling.  It is a
bit confusing.  Is SIGALRM completely available to a module now?  It looks
like Apache is just using the scoreboard and not actually using a real
SIGALRM.  If someone could spend 3 minutes and outline how I might call
alarm() safely in an Apache module, I would appreciate it.

-Rasmus


Re: SIGALRM usage in modules?

Posted by Dean Gaudet <dg...@arctic.org>.
It's not really available ... the only hackish way to do it is to do
things like rfc1413.c does it.  I stopped short of freeing SIGALRM for
module use.  After noting the timeout in the scoreboard, the parent is
responsible for implementing the timer.  The parent uses SIGALRM to signal
the child.  But it can only do this with shared-mem scoreboards (and when
there's actually a parent).

If you kill_timeout() you may install your own SIGALRM signal handler,
provided you restore the original IN ALL SITUATIONS before the next
request (I suggest a pool cleanup might be a good thing).  The timeout()
handler in http_main.c also handles SIGPIPE, so beware. 

Another 2.0 wishlist item: abstracted timeouts.

Dean

On Sat, 22 Nov 1997, Rasmus Lerdorf wrote:

> I have been trying to sort through the code to figure out whether setting
> an alarm in a module will interfere with Apache's alarm handling.  It is a
> bit confusing.  Is SIGALRM completely available to a module now?  It looks
> like Apache is just using the scoreboard and not actually using a real
> SIGALRM.  If someone could spend 3 minutes and outline how I might call
> alarm() safely in an Apache module, I would appreciate it.
> 
> -Rasmus
> 
>