executing default signal handler

The GNU C Library Reference Manual has a whole chapter explaining everything about signal handling. You always get the previously set signal handler (a function pointer) when you install your own handler (see manpages for signal() or sigaction()). previous_handler = signal(SIGINT, myhandler); The general rule is, that you can always reset to the previous handler … Read more

Linux: Why is sig_atomic_t typedef’ed to int?

C99 sig_atomic_t conforms only to a very weak definition of “atomicity”, because C99 has no concept of concurrency, only interruptibility. (C2011 adds a concurrency model, and with it the _Atomic types that make stronger guarantees; however, AFAIK sig_atomic_t is unchanged, since its raison d’ĂȘtre is still communication with signal handlers, not across threads.) This is … Read more

Under what circumstances are C++ destructors not going to be called?

Are there any other circumstances where they[destructors] will not be called? Long jumps: these interfere with the natural stack unwinding process and often lead to undefined behavior in C++. Premature exits (you already pointed these out, though it’s worth noting that throwing while already stack unwinding as a result of an exception being thrown leads … Read more