9 #define TEST(c, ...) ((c) ? 1 : (error(#c" failed: " __VA_ARGS__),0))
10 #define TESTE(c) (errno=0, TEST(c, "errno = %s\n", strerror(errno)))
14 volatile int x = 0, r;
17 volatile sigset_t oldset;
24 TEST(x==1, "setjmp/longjmp seems to have been bypassed\n");
32 TEST(r==1, "longjmp(jb, 0) caused setjmp to return %d\n", r);
35 sigaddset(&set, SIGUSR1);
36 sigprocmask(SIG_UNBLOCK, &set, &set);
39 /* Improve the chances of catching failure of sigsetjmp to
40 * properly save the signal mask in the sigjmb_buf. */
41 memset(&sjb, -1, sizeof sjb);
43 if (!sigsetjmp(sjb, 1)) {
45 sigaddset(&set, SIGUSR1);
46 sigprocmask(SIG_BLOCK, &set, 0);
50 sigprocmask(SIG_SETMASK, &set, &set);
51 TEST(sigismember(&set, SIGUSR1)==0, "siglongjmp failed to restore mask\n");