Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!snorkelwacker.mit.edu!thunder.mcrcim.mcgill.edu!mouse From: mouse@thunder.mcrcim.mcgill.edu (der Mouse) Newsgroups: comp.unix.questions Subject: Re: What was the signal? Message-ID: <1991Mar25.120829.26404@thunder.mcrcim.mcgill.edu> Date: 25 Mar 91 12:08:29 GMT References: <1991Mar20.113657.1959@ukpoit.co.uk> <1991Mar20.114107.2078@ukpoit.co.uk> Organization: McGill Research Centre for Intelligent Machines Lines: 21 In article <1991Mar20.114107.2078@ukpoit.co.uk>, alan@ukpoit.co.uk (Alan Barclay) writes: > In article <1991Mar20.113657.1959@ukpoit.co.uk> howard@ukpoit.co.uk (Howard the Hacker) writes: >> I have a C program doing a msgrcv(2) which may be interrupted by a >> SIGALRM. This is processed by a handler function. [...] [I]s it >> possible to find out what the actual signal was? If the signal was >> not SIGALRM, the msgrcv should not be tried again, but how can I >> tell? > catch SIGALRM, using signal(2), set a flag in the signal catching > routine, and check for the flag being set. That will tell only whether SIGALRM occurred, not whether some other signal also occurred. If a SIGHUP is delivered during the SIGALRM handler, for example, processing should stop, but the flag will be set just the same.... der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu