1 /* $NetBSD: sigalarm.c,v 1.1 2003/09/12 21:15:06 christos Exp $ */
4 * Regression test for sigsuspend in libpthread when pthread lib is
19 static void alarm_handler(int, siginfo_t
*, void *);
21 alarm_handler(int signo
, siginfo_t
*si
, void *ctx
)
23 if (si
->si_signo
!= signo
)
24 errx(1, "Received unexpected signal %d", signo
);
28 static void alarm_handler(int);
30 alarm_handler(int signo
)
33 errx(1, "Received unexpected signal %d", signo
);
44 sa
.sa_flags
= SA_SIGINFO
;
45 sa
.sa_sigaction
= alarm_handler
;
48 sa
.sa_handler
= alarm_handler
;
51 sigprocmask(SIG_SETMASK
, &ss
, NULL
);
52 sigemptyset(&sa
.sa_mask
);
53 sigaction(SIGALRM
, &sa
, NULL
);
59 main(int argc
, char **argv
)
62 pthread_t self
= pthread_self();
64 if (pthread_create(&self
, NULL
, setup
, NULL
) != 0)
65 err(1, "Cannot create thread");
72 errx(1, "alarm_set not set");