xref: /haiku/headers/posix/setjmp.h (revision 4f00613311d0bd6b70fa82ce19931c41f071ea4e)
1 /*
2  * Copyright 2004-2005, Haiku, Inc.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _SETJMP_H_
6 #define _SETJMP_H_
7 
8 #include <signal.h>
9 
10 // include architecture specific definitions
11 #ifdef __INTEL__
12 	#include <arch/x86/arch_setjmp.h>
13 #elif __POWERPC__
14 	#include <arch/ppc/arch_setjmp.h>
15 #endif
16 
17 typedef struct __jmp_buf_tag {
18 	__jmp_buf	regs;		/* saved registers, stack & program pointer */
19 	int			mask_was_saved;
20 	sigset_t	saved_mask;
21 } jmp_buf[1];
22 
23 typedef jmp_buf sigjmp_buf;
24 
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 extern int	_setjmp(jmp_buf jumpBuffer);
31 extern int	setjmp(jmp_buf jumpBuffer);
32 extern int	sigsetjmp(jmp_buf jumpBuffer, int saveMask);
33 
34 extern void	_longjmp(jmp_buf jumpBuffer, int value);
35 extern void	longjmp(jmp_buf jumpBuffer, int value);
36 extern void	siglongjmp(sigjmp_buf jumpBuffer, int value);
37 
38 #ifdef __cplusplus
39 }
40 #endif
41 
42 #endif /* _SETJMP_H_ */
43