Article View: vmsnet.alpha
Article #9Re: SIGINT handles only once
From: George J. Carrette
Date: Wed, 23 Dec 1992 16:02
Date: Wed, 23 Dec 1992 16:02
27 lines
1400 bytes
1400 bytes
In article <22DEC199220451474@eql.caltech.edu>, rankin@eql.caltech.edu (Pat Rankin) writes:
> You call printf() and then longjmp() out of a signal handler and end
> up surprised that there are problems?
If he wants to continue to kludge I can assure that the following code
(from SIOD) "works" on Alpha. Possibly it may work because of the
interposed stack frames, but I am also careful to never allow an err_ctrl_c()
call while already inside other calls to the VAXCRTL,
hence the nointerrupt flag. (If you cannot be good, at least be careful).
Note that when this code is run on the Macintosh I am forced to use
the polling technique anyway, because of a lack of interrupt capability.
void handle_sigint(int sig SIG_restargs)
{signal(SIGINT,handle_sigint);
if (nointerrupt == 1) interrupt_differed = 1;
else err_ctrl_c();}
void err_ctrl_c(void)
{err("control-c interrupt");}
void err(char *message)
{nointerrupt = 1;
printf("ERROR: %s\n",message);
longjmp(errjmp,1);}
Technical Details
Message-ID:
<4183@mitech.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!mitech!gjcReferences:
<1992Dec22.163159.22768@ann-arbor.applicon.slb.com> <22DEC199220451474@eql.caltech.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mitech!gjc From: gjc@mitech.com (George J. Carrette) Newsgroups: vmsnet.alpha Subject: Re: SIGINT handles only once Message-ID: <4183@mitech.com> Date: 23 Dec 92 16:02:32 GMT References: <1992Dec22.163159.22768@ann-arbor.applicon.slb.com> <22DEC199220451474@eql.caltech.edu> Distribution: world Organization: Mitech Corporation, Concord MA Lines: 27