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