1 /* 2 * Copyright 2004-2010 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 int mask_was_saved; 19 sigset_t saved_mask; 20 } jmp_buf[1]; 21 22 typedef jmp_buf sigjmp_buf; 23 24 25 #ifdef __cplusplus 26 extern "C" { 27 #endif 28 29 extern int _setjmp(jmp_buf jumpBuffer); 30 extern int setjmp(jmp_buf jumpBuffer); 31 extern int sigsetjmp(jmp_buf jumpBuffer, int saveMask); 32 33 extern void _longjmp(jmp_buf jumpBuffer, int value); 34 extern void longjmp(jmp_buf jumpBuffer, int value); 35 extern void siglongjmp(sigjmp_buf jumpBuffer, int value); 36 37 #ifdef __cplusplus 38 } 39 #endif 40 41 #endif /* _SETJMP_H_ */ 42