1 /*
2  * setjmp.h
3  */
4 
5 #ifndef _SETJMP_H
6 #define _SETJMP_H
7 
8 #include <klibc/extern.h>
9 #include <klibc/compiler.h>
10 #include <stddef.h>
11 
12 #if __SIZEOF_POINTER__ == 4
13 #include <klibc/i386/archsetjmp.h>
14 #elif __SIZEOF_POINTER__ == 8
15 #include <klibc/x86_64/archsetjmp.h>
16 #else
17 #error "unsupported architecture"
18 #endif
19 
20 __extern int setjmp(jmp_buf);
21 __extern __noreturn longjmp(jmp_buf, int);
22 
23 typedef jmp_buf sigjmp_buf;
24 
25 #define sigsetjmp(__env, __save) setjmp(__env)
26 #define siglongjmp(__env, __val) longjmp(__env, __val)
27 
28 #endif /* _SETJMP_H */
29