1

Is there any way I can separate the stacks of the context I get from getcontext()? Such that it is exact copy of parent with a different stack. So that when I use setcontext() or swapcontext() it would essentially work like a fork system call?

I want to be able to use it even after the calling function returns.

pizzaEatingGuy
  • 878
  • 3
  • 10
  • 19

1 Answers1

0

There is a uc_mcontext in the ucontext. It contains an array of registers one of them is the ESP register for 32bit machines. Which is the stack pointer of that context.

pizzaEatingGuy
  • 878
  • 3
  • 10
  • 19