Path: utzoo!attcan!uunet!mcsun!ukc!pyrltd!root44!gwc From: gwc@root.co.uk (Geoff Clare) Newsgroups: comp.unix.internals Subject: Re: abort may return (was: Re: Checking Exit Codes) Message-ID: <2518@root44.co.uk> Date: 5 Nov 90 14:03:04 GMT References: <18647@rpp386.cactus.org> <4057@awdprime.UUCP> <18658@rpp386.cactus.org> <8508@scolex.sco.COM> <18665@rpp386.cactus.org> Organization: UniSoft Ltd., London, England Lines: 33 In <18665@rpp386.cactus.org> jfh@rpp386.cactus.org (John F. Haugh II) writes: >the normal trick is to set SIGIOT to SIG_DFL, which prevents the signal >handler from ever catching SIGIOT. this isn't all that far-fetched as >other library routines catch certain signals, dork around a bit, then >re-send the same signal they just caught. >a conforming implementation might be >void >abort (void) >{ > signal (SIGABRT, SIG_DFL); > kill (getpid (), SIGABRT); > exit (1); >} If SIGABRT is being caught, the above will prevent the signal handler from being called. It should be: void abort (void) { (void) raise(SIGABRT); (void) signal(SIGABRT, SIG_DFL); (void) raise(SIGABRT); exit (1); } A POSIX version should unblock SIGABRT as well. -- Geoff Clare (Dumb American mailers: ...!uunet!root.co.uk!gwc) UniSoft Limited, Hayne Street, London EC1A 9HH, England. Tel: +44-71-315-6600