Save the environment, including the signal mask
#include <setjmp.h> int sigsetjmp( sigjmp_buf env, int savemask );
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The sigsetjmp() function behaves in the same way as the setjmp() function when savemask is zero. If savemask is nonzero, then sigsetjmp() also saves the thread's current signal mask as part of the calling environment.
|Don't use longjmp() or siglongjmp() to restore an environment saved by a call to setjmp() or sigsetjmp() in another thread. If you're lucky, your application will crash; if not, it'll look as if it works for a while, until random scribbling on the stack causes it to crash.|
Zero on the first call, or nonzero if the return is the result of a call to siglongjmp().
pthread_sigmask(), setjmp(), sigaction(), sigprocmask(), sigsuspend()