The regular signal handler is not lost, but returned when you install the client handler - therefore, it can work, just call this code as part of your own signal handler after you finish with any functionality available in your own handler.
So something like:
sighandler_t oldSigHandler = 0; void mySigHandler(int sig) { ... your code ... if (oldSigHandler) oldSigHandler(sig); } void setMySignalHandler(int sig) { oldSigHandler = signal(sig, mySigHandler); }
I usually perceive signal handlers as evil and try to avoid them, but this may work for you.
Alternatively, if you just want to avoid the kernel dump file, you can try to limit the allowed size of the kernel dump using ulimit -c from the shell or from your own code - however, the main files truncated in this way do not always work with gdb , which you need.
Soren
source share