diff options
author | 2003-07-10 21:02:12 +0000 | |
---|---|---|
committer | 2003-07-10 21:02:12 +0000 | |
commit | 2c323b514ee4f3da965604f65ffd043f8b313026 (patch) | |
tree | c79a0c610ecd2f46adb83d62ffa7807097eebf02 | |
parent | sync usage with manpage, add missing -R (diff) | |
download | wireguard-openbsd-2c323b514ee4f3da965604f65ffd043f8b313026.tar.xz wireguard-openbsd-2c323b514ee4f3da965604f65ffd043f8b313026.zip |
Add test to ensure that a masked signal with a default action of
terminate process doesn't terminate the process. It will until
a libpthread fix is verify and commited.
-rw-r--r-- | regress/lib/libpthread/sigmask/Makefile | 5 | ||||
-rw-r--r-- | regress/lib/libpthread/sigmask/sigmask.c | 32 |
2 files changed, 37 insertions, 0 deletions
diff --git a/regress/lib/libpthread/sigmask/Makefile b/regress/lib/libpthread/sigmask/Makefile new file mode 100644 index 00000000000..3c031fab6be --- /dev/null +++ b/regress/lib/libpthread/sigmask/Makefile @@ -0,0 +1,5 @@ +# $OpenBSD: Makefile,v 1.1 2003/07/10 21:02:12 marc Exp $ + +PROG= sigmask + +.include <bsd.regress.mk> diff --git a/regress/lib/libpthread/sigmask/sigmask.c b/regress/lib/libpthread/sigmask/sigmask.c new file mode 100644 index 00000000000..51b93486842 --- /dev/null +++ b/regress/lib/libpthread/sigmask/sigmask.c @@ -0,0 +1,32 @@ +/* $OpenBSD: sigmask.c,v 1.1 2003/07/10 21:02:12 marc Exp $ */ +/* PUBLIC DOMAIN July 2003 Marco S Hyman <marc@snafu.org> */ + +#include <sys/time.h> + +#include <pthread.h> +#include <signal.h> +#include <unistd.h> + +#include "test.h" + +/* + * Test that masked signals with a default action of terminate process + * do NOT terminate the process. + */ +int main (int argc, char *argv[]) +{ + sigset_t mask; + + /* mask sigalrm */ + CHECKe(sigemptyset(&mask)); + CHECKe(sigaddset(&mask, SIGALRM)); + CHECKe(pthread_sigmask(SIG_BLOCK, &mask, NULL)); + + /* now trigger sigalrm */ + ualarm(100000, 0); + + /* wait for it -- we shouldn't see it. */ + CHECKe(sleep(1)); + + SUCCEED; +} |