[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setjmp and friends



On Mon, 29 Nov 1999, Izar Tarandach wrote:

> /* Calling environment, plus possibly a saved signal mask.  */
> typedef struct __jmp_buf_tag    /* C++ doesn't like tagless structs.  */
> {
>   /* NOTE: The machine-dependent definitions of `__sigsetjmp'
>      assume that a `jmp_buf' begins with a `__jmp_buf'.
>      Do not move this member or add others before it.  */
>   __jmp_buf __jmpbuf;         /* Calling environment.  */
>   int __mask_was_saved;       /* Saved the signal mask?  */
>   __sigset_t __saved_mask;    /* Saved signal mask.  */
> } jmp_buf[1
> 
> What do you need more than this ? Your question is somewhat unclear.

I've already seen this thing many times.  Below there's an example of my
intentions:

An example, working on BSDI:
/* somewhere in the code */
jmp_buf jbuf[2];

/* later in the code: */

  setjmp(jbuf[0]);
  jbuf[0]->jb_esp = (unsigned) &stack1[1008];
  jbuf[0]->jb_eip = (unsigned) f; 
  jbuf[0]->jb_mask = 0;

/* end example */

I want to do the same thing on Linux.  I guess that the __jmpbuf field
is the place for the state etc., but how do I actually access its
components?

Regards,
Andre.


-- 
================================================================
#                       Andre E. Bar'yudin                     #
#           Home page: http://www.cs.huji.ac.il/~baryudin      #
#		   E-mail: baryudin@pob.huji.ac.il             #
#                      Phone: (972)-53-812-026                 #
================================================================


=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il