diff options
author | 2002-10-07 21:27:15 +0000 | |
---|---|---|
committer | 2002-10-07 21:27:15 +0000 | |
commit | 19eec2e2b186a48b65a05f6c75d32ddcf4012ab8 (patch) | |
tree | 47fd8a2a18499014b19184c7c32cad380f7b765f | |
parent | merge apache 1.3.27 (diff) | |
download | wireguard-openbsd-19eec2e2b186a48b65a05f6c75d32ddcf4012ab8.tar.xz wireguard-openbsd-19eec2e2b186a48b65a05f6c75d32ddcf4012ab8.zip |
add pthread siginfo support test
-rw-r--r-- | regress/lib/libc_r/Makefile | 4 | ||||
-rw-r--r-- | regress/lib/libc_r/siginfo/Makefile | 5 | ||||
-rw-r--r-- | regress/lib/libc_r/siginfo/siginfo.c | 30 | ||||
-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 |
6 files changed, 74 insertions, 4 deletions
diff --git a/regress/lib/libc_r/Makefile b/regress/lib/libc_r/Makefile index e360782f22c..450ecbc657f 100644 --- a/regress/lib/libc_r/Makefile +++ b/regress/lib/libc_r/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/libc_r/siginfo/Makefile b/regress/lib/libc_r/siginfo/Makefile new file mode 100644 index 00000000000..421ddecdb53 --- /dev/null +++ b/regress/lib/libc_r/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/libc_r/siginfo/siginfo.c b/regress/lib/libc_r/siginfo/siginfo.c new file mode 100644 index 00000000000..ab1fb62aac0 --- /dev/null +++ b/regress/lib/libc_r/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; +} 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; +} |