Search code examples
ccontext-switch

Question on sigsetjmp and siglongjmp


I am trying to understand the sigsetjmp() and siglongjmp() functions. The man pages state that sigsetjmp() saves the context and siglongjmp() restores the context. My question is, will they take care of stack pointer and program counter values as well?

Any links to extra resources are welcome.


Solution

  • Yes, it takes care of all the context. What that is exactly is implementation dependent.

    Be sure to read both the spec and your implementation's man pages, and be careful with these functions, they are tricky.