setjmplongjmp
Setjmplongjmp is a reference to the pair of C standard library facilities setjmp and longjmp, used to perform non-local jumps in C programs. They provide a mechanism to save the current execution state and later restore it, allowing control to return to an outer function call from a deeply nested level or from an error path.
The basic usage is that setjmp saves the program’s execution context (stack pointer, program counter, and other
What state is preserved and what is not is also important. The environment saved by setjmp/longjmp does
POSIX provides variants such as sigsetjmp and siglongjmp that also save and restore the process’s signal mask.