diff options
author | Marco S Hyman <marc@cvs.openbsd.org> | 2002-10-07 21:27:17 +0000 |
---|---|---|
committer | Marco S Hyman <marc@cvs.openbsd.org> | 2002-10-07 21:27:17 +0000 |
commit | 5b0ce9c27e0d80391525f05644835de44f7e8ec6 (patch) | |
tree | 29733ab67dc3da7f484b5275c79e7dcb9aaad47c /regress/lib/libpthread | |
parent | 908fe14881fb9d53bfe0f1cc94945b82cb9dd485 (diff) |
add pthread siginfo support test
Diffstat (limited to 'regress/lib/libpthread')
-rw-r--r-- | regress/lib/libpthread/Makefile | 4 | ||||
-rw-r--r-- | regress/lib/libpthread/siginfo/Makefile | 5 | ||||
-rw-r--r-- | regress/lib/libpthread/siginfo/siginfo.c | 30 |
3 files changed, 37 insertions, 2 deletions
diff --git a/regress/lib/libpthread/Makefile b/regress/lib/libpthread/Makefile index e360782f22c..450ecbc657f 100644 --- a/regress/lib/libpthread/Makefile +++ b/regress/lib/libpthread/Makefile @@ -1,9 +1,9 @@ -# $OpenBSD: Makefile,v 1.10 2002/06/23 20:21:22 marc Exp $ +# $OpenBSD: Makefile,v 1.11 2002/10/07 21:27:15 marc Exp $ SUBDIR= cancel close cwd execve fork group netdb pcap poll \ preemption preemption_float pthread_cond_timedwait pthread_create \ pthread_join pthread_mutex pthread_specific readdir select \ - setjmp signal sigsuspend sigwait sleep socket stdarg stdio \ + setjmp signal siginfo sigsuspend sigwait sleep socket stdarg stdio \ switch system # Not available or disabled: fcntl, pause, preemption_float and pw diff --git a/regress/lib/libpthread/siginfo/Makefile b/regress/lib/libpthread/siginfo/Makefile new file mode 100644 index 00000000000..421ddecdb53 --- /dev/null +++ b/regress/lib/libpthread/siginfo/Makefile @@ -0,0 +1,5 @@ +# $OpenBSD: Makefile,v 1.1 2002/10/07 21:27:16 marc Exp $ + +PROG= siginfo + +.include <bsd.regress.mk> diff --git a/regress/lib/libpthread/siginfo/siginfo.c b/regress/lib/libpthread/siginfo/siginfo.c new file mode 100644 index 00000000000..ab1fb62aac0 --- /dev/null +++ b/regress/lib/libpthread/siginfo/siginfo.c @@ -0,0 +1,30 @@ +/* $OpenBSD: siginfo.c,v 1.1 2002/10/07 21:27:16 marc Exp $ */ +/* PUBLIC DOMAIN Oct 2002 <marc@snafu.org> */ + +/* test SA_SIGINFO support */ + +#include <assert.h> +#include <signal.h> +#include <stdio.h> + +#include "test.h" + +void +act_handler(int signal, siginfo_t *siginfo, void *context) +{ + ASSERT(siginfo && siginfo->si_addr == (char *) 0x987234 && + siginfo->si_code == 1 && siginfo->si_trapno == 2); +} + +int +main(int argc, char **argv) +{ + struct sigaction act; + + act.sa_sigaction = act_handler; + sigemptyset(&act.sa_mask); + act.sa_flags = SA_SIGINFO; + CHECKe(sigaction(SIGSEGV, &act, NULL)); + *(char *) 0x987234 = 1; + SUCCEED; +} |