On 2/4/06, Nick Kew <[EMAIL PROTECTED]> wrote:
> Historically, different platforms have different signal semantics.
>
> I need to set up a signal handler. The primary targets are
> Linux and Solaris, but I'd much prefer cross-platform. And I'd
> like it to be MPM-agnostic in httpd, though the prime target
> is Worker.
>
> Is the following correct and complete for APR signals
> to function across platforms?
>
> static void my_handler(int signum) {
> apr_signal_block(signum) ;
> /* do things */
> apr_signal_unblock(signum) ;
> }
>
> static void my_child_init(args) {
> apr_signal(MY_SIGNAL, my_handler);
> }
That seems reasonable to me, although I suspect the behavior with
regard to how signals interact with threads will vary from system to
system, although apr_setup_signal_thread seems relevant to that part
of the problem...
-garrett