1989-05-16 13:13:53 +00:00
|
|
|
/*
|
|
|
|
* setjmp.h - restore calling environment
|
|
|
|
*
|
|
|
|
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
|
|
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
|
|
|
*/
|
|
|
|
/* $Header$ */
|
|
|
|
|
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
|
|
|
|
* sigset_t is larger than a long.
|
|
|
|
* The identifier __setjmp has a special meaning to the compiler.
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef char jmp_buf[ sizeof(long) + sizeof(int) + 3 * sizeof(void *)];
|
1989-05-16 13:13:53 +00:00
|
|
|
|
1990-01-22 13:20:42 +00:00
|
|
|
int __setjmp(jmp_buf __env, int __savemask);
|
|
|
|
|
|
|
|
#define setjmp(env) __setjmp(env, 0)
|
1989-09-29 15:46:33 +00:00
|
|
|
void longjmp(jmp_buf __env, int __val);
|
1989-05-16 13:13:53 +00:00
|
|
|
|
1990-01-22 13:20:42 +00:00
|
|
|
#if defined(_POSIX_SOURCE)
|
|
|
|
typedef jmp_buf sigjmp_buf;
|
|
|
|
#define sigsetjmp(env, savemask) __setjmp(env, savemask)
|
|
|
|
int siglongjmp(sigjmp_buf __env, int __val);
|
|
|
|
#endif
|
|
|
|
|
1989-12-18 14:00:32 +00:00
|
|
|
#endif /* _SETJMP_H */
|