Quote:> Why would one use these critters?
One would use them if one's program depends on the "setjmp"-like
operation saving the current value of the "signal mask", and the
"longjmp"-like operation restoring that value, and having the program
run correctly when compiled in environments where "setjmp()" and
"longjmp()" don't save or restore that signal mask.
POSIX says those routines should *not* save or restore the signal mask,
so in POSIX-compliant environments you have to use "sigsetjmp()" and
"siglongjmp()" with the second argument to "sigsetjmp" being non-zero.
E.g., one would use these routines if one would expect them to be run on
systems other than current BSD systems, or in the non-BSD environments
of multiple-environment systems; while the *current* BSD versions of
"setjmp()" and "longjmp()" save and restore the signal mask, future ones
will probably not do so, as future BSDs will probably be
POSIX-compliant.
(If you want to debate whether requiring that "setjmp()" and "longjmp()"
not save and restore the signal mask is a good idea, leave me out of the
debate - I no longer care, at this point, so go debate the POSIX folks
instead.)