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
|
$NetBSD: patch-ah,v 1.2 2000/05/27 09:53:37 wiz Exp $
--- glunix/src/signal/csignal.cc.orig Fri Oct 25 00:40:47 1996
+++ glunix/src/signal/csignal.cc Fri May 26 15:17:55 2000
@@ -111,6 +111,9 @@
#ifdef __svr4__
#define MAX_SIGNAL 35
#endif
+#ifdef __NetBSD__
+#define MAX_SIGNAL NSIG
+#endif
#define SIGNAL_MAX_HANDLERS 5
@@ -216,12 +219,18 @@
sigaddset(&allSignals, SIGTERM);
sigaddset(&allSignals, SIGUSR1);
sigaddset(&allSignals, SIGUSR2);
+#ifndef __NetBSD__
sigaddset(&allSignals, SIGCLD);
+#endif
sigaddset(&allSignals, SIGCHLD);
+#ifndef __NetBSD__
sigaddset(&allSignals, SIGPWR);
+#endif
sigaddset(&allSignals, SIGWINCH);
sigaddset(&allSignals, SIGURG);
+#ifndef __NetBSD__
sigaddset(&allSignals, SIGPOLL);
+#endif
sigaddset(&allSignals, SIGIO);
sigaddset(&allSignals, SIGSTOP);
sigaddset(&allSignals, SIGTSTP);
@@ -232,8 +241,9 @@
sigaddset(&allSignals, SIGPROF);
sigaddset(&allSignals, SIGXCPU);
sigaddset(&allSignals, SIGXFSZ);
+#ifndef __NetBSD__
sigaddset(&allSignals, SIGWAITING);
-
+#endif
initialized = True;
cleanedUp = False;
@@ -243,7 +253,7 @@
NULL /* callback function */, 0 /* callback arg */));
#ifdef DEBUG
- debug_cleanupCallbacks->Add((void (*)(int, void *))Signal_Cleanup, NULL);
+ debug_cleanupCallbacks->Add((void (*)(int, void *))Signal_Cleanup, 0);
#endif
return True;
@@ -438,7 +448,11 @@
} else {
if (found) {
// Otherwise, we're not catching it and we should be
+#ifdef __NetBSD__
+ signal(sig, CatchSignal);
+#else
sigset(sig, CatchSignal);
+#endif
}
}
return;
@@ -863,11 +877,18 @@
Bool
Signal_Hold(int sig)
{
- if (sighold(sig) < 0) {
- return False;
- } else {
- return True;
- }
+#ifdef __NetBSD__
+int i;
+ i = sigsetmask(0);
+ i &= ~sigmask(sig);
+ if (sigsetmask(i) < 0) {
+#else
+ if (sighold(sig) < 0) {
+#endif
+ return False;
+ } else {
+ return True;
+ }
}
/******************************************************************************
@@ -885,7 +906,11 @@
Bool
Signal_Release(int sig)
{
+#ifdef __NetBSD__
+ if (sigsetmask(sigmask(sig)) < 0 ) {
+#else
if (sigrelse(sig) < 0) {
+#endif
return False;
} else {
return True;
|