"JS" <dsa.@asdf.com> wrote:
I have this struct:
struct pcb {
void *(*start_routine) (void *);
void *arg;
jmp_buf state;
int stak[1024];
};
when I make a call to setjmp somwehere in my code what is it excately that
setjmp store in "state"?
Whatever it needs to. The Standard doesn't specify the details, only
that a jmp_buf is an array and that it holds whatever information
setjmp() and longjmp() need to do their job - and that this includes
only the state necessary to make the jump, not the state of floating
point flags, open files, et cetera. This may include a stack pointer (in
fact, it will need to include _some_ kind of stack pointer, just not
necessarily the processor's SP register), and may include other details.
Richard