I\'m just playing with signal in Mac OS X.
Why does the following code not produce the default behavior of SIGSEGV after my signal handler has finished? Under Linux,
According to POSIX:
If any of the SIGFPE, SIGILL, SIGSEGV, or SIGBUS signals are generated while they are blocked the result is undefined, unless the signal was generated by the
kill()function, thesigqueue()function, or theraise()function.
Because SIGSEGV is blocked while in the SIGSEGV signal handler, the result is undefined in this case and any behavior is valid. If you don't want it to be blocked you could install the signal handler using sigaction() with the SA_NODEFER flag, or use sigprocmask() to unblock the signal within the signal handler.