Hal Vaughan <hal@[EMAIL PROTECTED]
> writes:
> Jeff Schwab wrote:
>
>> Hal Vaughan wrote:
>>> Is there any way to catch a kill signal and if one is sent,
>>> do some closing down routines before dying?
>>
>> It's usually not too difficult, but is inherently somewhat
non-****table.
>> If Boost.Test doesn't do what you need, and you're on a POSIX system,
>> try installing handlers for SIGSEGV and whatever other signals interest
>> you using the POSIX sigaction function.
>
> It's on Linux and I seriously doubt this will be used on another OS, but
it
> is possible. I can always leave that issue up to the masochist that
wants
> to ****t the code over.
It actually doesn't need to be un****table: standard C (and, thereby,
C++) provides signal handling in <signal.h> (<csignal> in C++, natch).
On POSIX systems, however, sigaction() is often preverable to standard
C's signal() as it provides more options; but just wanted to point out
that ****table options exist. And for many cases, signal() is more than
adequate (it is still quite frequently used in many Unix programs).
--
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/


|