8 #include <klibc/extern.h>
9 #include <klibc/compiler.h>
13 #include <klibc/archsetjmp.h>
15 __extern int setjmp(jmp_buf);
16 __extern __noreturn longjmp(jmp_buf, int);
19 Whose bright idea was it to add unrelated functionality to just about
20 the only function in the standard C library (setjmp) which cannot be
21 wrapped by an ordinary function wrapper? Anyway, the damage is done,
22 and therefore, this wrapper *must* be inline. However, gcc will
23 complain if this is an inline function for unknown reason, and
24 therefore sigsetjmp() needs to be a macro.
32 typedef struct __sigjmp_buf sigjmp_buf[1];
34 #define sigsetjmp(__env, __save) \
36 struct __sigjmp_buf *__e = (__env); \
37 sigprocmask(0, NULL, &__e->__sigs); \
38 setjmp(__e->__jmpbuf); \
41 __extern __noreturn siglongjmp(sigjmp_buf, int);
43 #endif /* _SETJMP_H */