summaryrefslogtreecommitdiff
path: root/sysutils/strace/patches/patch-signal.c
blob: ab62e9cee113f67aa57134633460108fb78d1cb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
$NetBSD: patch-signal.c,v 1.1 2019/01/22 22:07:33 christos Exp $

--- signal.c.orig	2007-01-11 17:08:38.000000000 -0500
+++ signal.c	2019-01-22 16:54:46.145801860 -0500
@@ -36,12 +36,29 @@
 #include "defs.h"
 
 #include <signal.h>
+#include <sys/param.h>
+#ifndef NETBSD
 #include <sys/user.h>
+#endif
 #include <fcntl.h>
 
-#ifdef SVR4
+#if defined(SVR4) || defined(NETBSD)
 #include <sys/ucontext.h>
 #endif /* SVR4 */
+#ifdef NETBSD
+#if !defined(UC_CPU) && defined(_UC_CPU)
+#define UC_CPU _UC_CPU
+#endif
+#if !defined(UC_SIGMASK) && defined(_UC_SIGMASK)
+#define UC_SIGMASK _UC_SIGMASK
+#endif
+#if !defined(UC_STACK) && defined(_UC_STACK)
+#define UC_STACK _UC_STACK
+#endif
+#if !defined(UC_FPU) && defined(_UC_FPU)
+#define UC_FPU _UC_FPU
+#endif
+#endif
 
 #ifdef HAVE_SYS_REG_H
 # include <sys/reg.h>
@@ -1056,14 +1073,14 @@
 	return 0;
 }
 
-#if defined(SUNOS4) || defined(FREEBSD)
+#if defined(SUNOS4) || defined(ALLBSD)
 int
 sys_sigblock(tcp)
 struct tcb *tcp;
 {
 	return sys_sigsetmask(tcp);
 }
-#endif /* SUNOS4 || FREEBSD */
+#endif /* SUNOS4 || ALLBSD */
 
 #endif /* !SVR4 */
 
@@ -1165,13 +1182,13 @@
 		printsignal(tcp->u_arg[0]);
 		tprintf(", ");
 		switch (tcp->u_arg[1]) {
-		case (int) SIG_ERR:
+		case (long) SIG_ERR:
 			tprintf("SIG_ERR");
 			break;
-		case (int) SIG_DFL:
+		case (long) SIG_DFL:
 			tprintf("SIG_DFL");
 			break;
-		case (int) SIG_IGN:
+		case (long) SIG_IGN:
 #ifndef USE_PROCFS
 			if (tcp->u_arg[0] == SIGTRAP) {
 				tcp->flags |= TCB_SIGTRAPPED;
@@ -1193,11 +1210,11 @@
 	}
 	else {
 		switch (tcp->u_rval) {
-		    case (int) SIG_ERR:
+		    case (long) SIG_ERR:
 			tcp->auxstr = "SIG_ERR"; break;
-		    case (int) SIG_DFL:
+		    case (long) SIG_DFL:
 			tcp->auxstr = "SIG_DFL"; break;
-		    case (int) SIG_IGN:
+		    case (long) SIG_IGN:
 			tcp->auxstr = "SIG_IGN"; break;
 		    default:
 			tcp->auxstr = NULL;
@@ -1489,7 +1506,7 @@
 
 #endif /* LINUX */
 
-#if defined(SVR4) || defined(FREEBSD)
+#if defined(SVR4) || defined(ALLBSD)
 
 int
 sys_sigsuspend(tcp)
@@ -1521,7 +1538,7 @@
 #endif /* !FREEBSD */
 #endif /* SVR4 || FREEBSD */
 
-#if defined SVR4 || defined LINUX || defined FREEBSD
+#if defined SVR4 || defined LINUX || defined ALLBSD
 #if defined LINUX && !defined SS_ONSTACK
 #define SS_ONSTACK      1
 #define SS_DISABLE      2
@@ -1613,7 +1630,7 @@
 
 #endif /* SVR4 */
 
-#if defined(LINUX) || defined(FREEBSD)
+#if defined(LINUX) || defined(ALLBSD)
 
 static int
 print_stack_t(tcp, addr)
@@ -1702,14 +1719,14 @@
 	return 0;
 }
 
-#if defined(FREEBSD) || defined(SUNOS4)
+#if defined(ALLBSD) || defined(SUNOS4)
 int
 sys_killpg(tcp)
 struct tcb *tcp;
 {
 	return sys_kill(tcp);
 }
-#endif /* FREEBSD || SUNOS4 */
+#endif /* ALLBSD || SUNOS4 */
 
 #ifdef LINUX
 int