linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* setjmp/longjmp's enviroment
@ 2004-11-19  7:14 rinku rathore
  2004-11-19 15:45 ` Glynn Clements
  0 siblings, 1 reply; 2+ messages in thread
From: rinku rathore @ 2004-11-19  7:14 UTC (permalink / raw)
  To: Vger Kernel

Hello All,
I wanted to know about "setjmp/longjmp",
What I understood is setjmp will save the current
environment of the program but cann't get much about
hte enviroment can anybody give me detail about the
environment.I get that it will save the fp,stack
pointer, program counter what else it will store.

please help me,
thanx in advance,
Regards,
Rinku Rathore.


		
__________________________________ 
Do you Yahoo!? 
Meet the all-new My Yahoo! - Try it today! 
http://my.yahoo.com 
 


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: setjmp/longjmp's enviroment
  2004-11-19  7:14 setjmp/longjmp's enviroment rinku rathore
@ 2004-11-19 15:45 ` Glynn Clements
  0 siblings, 0 replies; 2+ messages in thread
From: Glynn Clements @ 2004-11-19 15:45 UTC (permalink / raw)
  To: rinku rathore; +Cc: Vger Kernel


rinku rathore wrote:

> I wanted to know about "setjmp/longjmp",
> What I understood is setjmp will save the current
> environment of the program but cann't get much about
> hte enviroment can anybody give me detail about the
> environment.I get that it will save the fp,stack
> pointer, program counter what else it will store.

On x86, setjmp() stores the registers: EBX, ESI, EDI, EBP, ESP, EIP;
sigsetjmp() may additionally save the signal mask. It doesn't save the
FPU state.

Essentially, it saves the registers which need to be preserved across
a function call, so that a return from setjmp() via longjmp() appears
the same as a return from a normal function call (i.e. EAX, ECX and
EDX may contain garbage; the others must be preserved).

-- 
Glynn Clements <glynn@gclements.plus.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-11-19 15:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-19  7:14 setjmp/longjmp's enviroment rinku rathore
2004-11-19 15:45 ` Glynn Clements

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).