| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: t_sigqueue.c,v 1.1 2011/01/10 04:57:56 christos Exp $ */ | | 1 | /* $NetBSD: t_sigqueue.c,v 1.2 2011/01/10 05:15:00 christos Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2011 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2011 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Christos Zoulas. | | 8 | * by Christos Zoulas. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -27,43 +27,43 @@ | | | @@ -27,43 +27,43 @@ |
27 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 27 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
28 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 28 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
29 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 29 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
30 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 30 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
31 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 31 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
32 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 32 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
33 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 33 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
34 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 34 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
35 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 35 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
36 | * POSSIBILITY OF SUCH DAMAGE. | | 36 | * POSSIBILITY OF SUCH DAMAGE. |
37 | */ | | 37 | */ |
38 | | | 38 | |
39 | #include <sys/cdefs.h> | | 39 | #include <sys/cdefs.h> |
40 | __RCSID("$NetBSD: t_sigqueue.c,v 1.1 2011/01/10 04:57:56 christos Exp $"); | | 40 | __RCSID("$NetBSD: t_sigqueue.c,v 1.2 2011/01/10 05:15:00 christos Exp $"); |
41 | | | 41 | |
42 | #include <signal.h> | | 42 | #include <signal.h> |
43 | #include <unistd.h> | | 43 | #include <unistd.h> |
44 | #include <stdlib.h> | | 44 | #include <stdlib.h> |
45 | #include <sched.h> | | 45 | #include <sched.h> |
46 | #include <err.h> | | 46 | #include <err.h> |
47 | | | 47 | |
48 | #include <atf-c.h> | | 48 | #include <atf-c.h> |
49 | | | 49 | |
50 | ATF_TC(sigqueue); | | 50 | ATF_TC(sigqueue); |
51 | ATF_TC_HEAD(sigqueue, tc) | | 51 | ATF_TC_HEAD(sigqueue, tc) |
52 | { | | 52 | { |
53 | atf_tc_set_md_var(tc, "descr", "Checks sigqueue sigval delivery"); | | 53 | atf_tc_set_md_var(tc, "descr", "Checks sigqueue sigval delivery"); |
54 | } | | 54 | } |
55 | | | 55 | |
56 | #define VALUE (int)0xc001dadd1 | | 56 | #define VALUE (int)0xc001dad1 |
57 | static int value; | | 57 | static int value; |
58 | | | 58 | |
59 | static void | | 59 | static void |
60 | /*ARGSUSED*/ | | 60 | /*ARGSUSED*/ |
61 | handler(int signo, siginfo_t *info, void *data) | | 61 | handler(int signo, siginfo_t *info, void *data) |
62 | { | | 62 | { |
63 | value = info->si_value.sival_int; | | 63 | value = info->si_value.sival_int; |
64 | kill(0, SIGINFO); | | 64 | kill(0, SIGINFO); |
65 | } | | 65 | } |
66 | | | 66 | |
67 | ATF_TC_BODY(sigqueue, tc) | | 67 | ATF_TC_BODY(sigqueue, tc) |
68 | { | | 68 | { |
69 | struct sigaction sa; | | 69 | struct sigaction sa; |