Xref: utzoo comp.lang.c:16818 comp.unix.questions:12117 comp.unix.wizards:15003 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!gatech!purdue!decwrl!megatest!djones From: djones@megatest.UUCP (Dave Jones) Newsgroups: comp.lang.c,comp.unix.questions,comp.unix.wizards Subject: Re: Interrupt Handler in 'C' Message-ID: <2763@goofy.megatest.UUCP> Date: 9 Mar 89 03:51:03 GMT References: <2762@goofy.megatest.UUCP> Organization: Megatest Corporation, San Jose, Ca Lines: 23 I just realized that I don't have to call sigsetmask to get the old signal-mask. It's available in the struct sigcontext: sigalrm_handler(sig,code,context) struct sigcontext *scp; { static int handler_active = 0; static jmp_buf first_handler; int handler_mask; if(handler_active) longjmp(first_handler, 1); handler_active = 1; setjmp(first_handler); handler_mask = sigsetmask(scp->sc_mask); B(); sigsetmask(handler_mask); handler_active = 0; }