xref: /haiku/headers/posix/setjmp.h (revision b5c6c8b6b58bbc4998653e56dc52f69ca11ac21f)
1*b5c6c8b6SAxel Dörfler /*
2*b5c6c8b6SAxel Dörfler ** Distributed under the terms of the Haiku License.
3*b5c6c8b6SAxel Dörfler */
4*b5c6c8b6SAxel Dörfler #ifndef _SETJMP_H_
5*b5c6c8b6SAxel Dörfler #define _SETJMP_H_
6*b5c6c8b6SAxel Dörfler 
7*b5c6c8b6SAxel Dörfler 
8*b5c6c8b6SAxel Dörfler #include <signal.h>
9*b5c6c8b6SAxel Dörfler 
10*b5c6c8b6SAxel Dörfler 
11*b5c6c8b6SAxel Dörfler typedef struct __jmp_buf {
12*b5c6c8b6SAxel Dörfler 	int			regs[6];	/* saved registers, stack & program pointer */
13*b5c6c8b6SAxel Dörfler 	int			mask_was_saved;
14*b5c6c8b6SAxel Dörfler 	sigset_t	saved_mask;
15*b5c6c8b6SAxel Dörfler } jmp_buf[1];
16*b5c6c8b6SAxel Dörfler 
17*b5c6c8b6SAxel Dörfler typedef jmp_buf sigjmp_buf;
18*b5c6c8b6SAxel Dörfler 
19*b5c6c8b6SAxel Dörfler 
20*b5c6c8b6SAxel Dörfler #ifdef __cplusplus
21*b5c6c8b6SAxel Dörfler extern "C" {
22*b5c6c8b6SAxel Dörfler #endif
23*b5c6c8b6SAxel Dörfler 
24*b5c6c8b6SAxel Dörfler extern int	_setjmp(jmp_buf jumpBuffer);
25*b5c6c8b6SAxel Dörfler extern int	setjmp(jmp_buf jumpBuffer);
26*b5c6c8b6SAxel Dörfler extern int	sigsetjmp(jmp_buf jumpBuffer, int saveMask);
27*b5c6c8b6SAxel Dörfler 
28*b5c6c8b6SAxel Dörfler extern void	_longjmp(jmp_buf jumpBuffer, int value);
29*b5c6c8b6SAxel Dörfler extern void	longjmp(jmp_buf jumpBuffer, int value);
30*b5c6c8b6SAxel Dörfler extern void	siglongjmp(sigjmp_buf jumpBuffer, int value);
31*b5c6c8b6SAxel Dörfler 
32*b5c6c8b6SAxel Dörfler #ifdef __cplusplus
33*b5c6c8b6SAxel Dörfler }
34*b5c6c8b6SAxel Dörfler #endif
35*b5c6c8b6SAxel Dörfler 
36*b5c6c8b6SAxel Dörfler #endif /* _SETJMP_H_ */
37