| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: abortfixup.c,v 1.8 2008/04/28 20:23:05 martin Exp $ */ | | 1 | /* $NetBSD: abortfixup.c,v 1.9 2011/05/18 19:44:18 mellon Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2001 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2001 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -22,33 +22,34 @@ | | | @@ -22,33 +22,34 @@ |
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
26 | * POSSIBILITY OF SUCH DAMAGE. | | 26 | * POSSIBILITY OF SUCH DAMAGE. |
27 | * | | 27 | * |
28 | * | | 28 | * |
29 | * Trying out if an unhandled instruction pattern in the late abort fixup | | 29 | * Trying out if an unhandled instruction pattern in the late abort fixup |
30 | * generates a panic or sysfaults like it ought to do. | | 30 | * generates a panic or sysfaults like it ought to do. |
31 | */ | | 31 | */ |
32 | | | 32 | |
33 | #include <sys/types.h> | | 33 | #include <sys/types.h> |
34 | | | 34 | |
35 | __RCSID("$NetBSD: abortfixup.c,v 1.8 2008/04/28 20:23:05 martin Exp $"); | | 35 | __RCSID("$NetBSD: abortfixup.c,v 1.9 2011/05/18 19:44:18 mellon Exp $"); |
36 | | | 36 | |
37 | #include <setjmp.h> | | 37 | #include <setjmp.h> |
38 | #include <signal.h> | | 38 | #include <signal.h> |
39 | #include <stdio.h> | | 39 | #include <stdio.h> |
40 | #include <stdlib.h> | | 40 | #include <stdlib.h> |
41 | #include <stdio.h> | | 41 | #include <stdio.h> |
| | | 42 | #include <err.h> |
42 | | | 43 | |
43 | jmp_buf buf; | | 44 | jmp_buf buf; |
44 | | | 45 | |
45 | void | | 46 | void |
46 | sighandler(int sig) | | 47 | sighandler(int sig) |
47 | { | | 48 | { |
48 | | | 49 | |
49 | /* Catching SIGSEGV means the test passed. */ | | 50 | /* Catching SIGSEGV means the test passed. */ |
50 | longjmp(buf, 1); | | 51 | longjmp(buf, 1); |
51 | } | | 52 | } |
52 | | | 53 | |
53 | int | | 54 | int |
54 | main(void) | | 55 | main(void) |