Alan Burlison <Alan.Burlison@uk.sun.com> writes: >Nick Ing-Simmons wrote: > >> Apparently not. I cannot at present think what sigsetjmp() gains >> us. Do you have an guidelines which say "use sigsetjmp() if your code does X?" > >In perl terms, I think the only time this would happen is if you did a >die inside a signal handler, and expected to go back to an enclosing >eval() with the signal handler restored. I am sure we could do something special round perl signal handlers and leave the vast bulk of other eval {} / G_EVAL code using normal setjmp(). Unless there is a more obvious/portable mechanism to save/restore the mask then something like: void invoke_handler(...) { code = sigsetjmp(...); if (!code) { perl_call_xxx(...,G_EVAL|G_VOID); if (SvTRUE(PL_errsv)) siglongjmp(...,1); } } should do it. -- Nick Ing-Simmons <nik@tiuk.ti.com> Via, but not speaking for: Texas Instruments Ltd.Thread Previous | Thread Next