1989-05-16 13:13:53 +00:00
|
|
|
/*
|
1990-10-26 11:31:27 +00:00
|
|
|
* setjmp.h - save/restore calling environment
|
1989-05-16 13:13:53 +00:00
|
|
|
*
|
|
|
|
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
|
|
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
|
|
|
*/
|
1994-06-24 14:02:31 +00:00
|
|
|
/* $Id$ */
|
1989-05-16 13:13:53 +00:00
|
|
|
|
1989-12-18 14:00:32 +00:00
|
|
|
#if !defined(_SETJMP_H)
|
|
|
|
#define _SETJMP_H
|
1989-05-16 13:13:53 +00:00
|
|
|
|
1990-01-22 13:20:42 +00:00
|
|
|
/* In a jmp_buf, there is room for: 1 mask (long), 1 flag (int) and 3
|
|
|
|
* pointers (stack-pointer, local base and program-counter). This may be
|
|
|
|
* too big, but that doesn't matter. It could also be too small, when
|
1990-10-26 11:31:27 +00:00
|
|
|
* sigset_t is larger than a long. The fields is in the structure have no
|
|
|
|
* meaning, they just get the size right.
|
1990-01-22 13:20:42 +00:00
|
|
|
* The identifier __setjmp has a special meaning to the compiler.
|
|
|
|
*/
|
|
|
|
|
1990-10-26 11:31:27 +00:00
|
|
|
typedef struct {
|
|
|
|
long __mask;
|
|
|
|
int __flag;
|
1990-11-06 10:49:12 +00:00
|
|
|
void (*__pc)(void);
|
1990-10-26 11:31:27 +00:00
|
|
|
void *__sp;
|
|
|
|
void *__lb;
|
|
|
|
} jmp_buf[1];
|
1989-05-16 13:13:53 +00:00
|
|
|
|
2007-04-24 19:42:24 +00:00
|
|
|
extern int __setjmp(jmp_buf _env, int _savemask);
|
1990-01-22 13:20:42 +00:00
|
|
|
|
|
|
|
#define setjmp(env) __setjmp(env, 0)
|
2007-04-24 19:42:24 +00:00
|
|
|
extern void longjmp(jmp_buf _env, int _val);
|
1990-01-22 13:20:42 +00:00
|
|
|
|
1989-12-18 14:00:32 +00:00
|
|
|
#endif /* _SETJMP_H */
|