Article View: comp.std.c
Article #4313longjmp/signals
From: Ian Cargill
Date: Wed, 01 Nov 1995 16:18
Date: Wed, 01 Nov 1995 16:18
30 lines
1593 bytes
1593 bytes
The standard says (my caps): # However, if the longjmp function is invoked from a nested # signal handler (that is, from a function invoked as a result # of A SIGNAL RAISED during the handling of another signal), # the behavior is undefined. Consider a signal handlers, sig_hand, set up using - signal(SIGONE, sig_hand); There is a SIGONE exception and sig_hand is now executing. Two possibilities (of interest) are: 1. sig_hand calls raise(SIGSOMETHING); 2. another (async) exception is raised. Since the standard makes no restriction on how the second signal is raised (as in caps), I assume both actions result in undefined behaviour. Since there is no way of disabling external interrupts, this would seem to make it impossible to guarantee defined behaviour. Is 'nested' intended to only refer to 'nested function calls' as in case 1? That is how I think it _should_ read, but not how I think it _does_ read. -- ============================================================================ Ian Cargill CEng MIEE | Find out about the Association of C and C++ Users Soliton Software Ltd. | info@accu.org OR http://www.accu.org/accu
Technical Details
Message-ID:
<815242697snz@soliton.demon.co.uk>Path:
arc1-ca.pugleaf.net!mail2news.demon.co.uk!soliton.demon.co.ukShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!mail2news.demon.co.uk!soliton.demon.co.uk From: Ian Cargill <ian@soliton.demon.co.uk> Newsgroups: comp.std.c Subject: longjmp/signals Date: Wed, 01 Nov 95 16:18:17 GMT Organization: Soliton Software Ltd. Message-ID: <815242697snz@soliton.demon.co.uk> Reply-To: ian@soliton.demon.co.uk X-NNTP-Posting-Host: soliton.demon.co.uk X-Newsreader: Demon Internet Simple News v1.30