Print this page
make: unifdef SUN5_0 (defined)
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/make/lib/bsd/bsd.cc
+++ new/usr/src/cmd/make/lib/bsd/bsd.cc
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 25
26 26
27 27 #include <signal.h>
28 28
29 29 #include <bsd/bsd.h>
30 30
31 31 /* External references.
32 32 */
33 33
↓ open down ↓ |
33 lines elided |
↑ open up ↑ |
34 34 /* Forward references.
35 35 */
36 36
37 37 /* Static data.
38 38 */
39 39
40 40 extern SIG_PF
41 41 bsd_signal (int Signal, SIG_PF Handler)
42 42 {
43 43 auto SIG_PF previous_handler;
44 -#ifdef SUN5_0
45 44 #ifdef sun
46 45 previous_handler = sigset (Signal, Handler);
47 46 #else
48 47 auto struct sigaction new_action;
49 48 auto struct sigaction old_action;
50 49
51 50 new_action.sa_flags = SA_SIGINFO;
52 51 new_action.sa_handler = (void (*) ()) Handler;
53 52 (void) sigemptyset (&new_action.sa_mask);
54 53 (void) sigaddset (&new_action.sa_mask, Signal);
55 54
56 55 (void) sigaction (Signal, &new_action, &old_action);
57 56
58 57 previous_handler = (SIG_PF) old_action.sa_handler;
59 58 #endif
60 -#elif defined(linux)
61 - previous_handler = sigset (Signal, Handler);
62 -#else
63 - previous_handler = signal (Signal, Handler);
64 -#endif
65 59 return previous_handler;
66 60 }
67 61
68 62 extern void
69 63 bsd_signals (void)
70 64 {
71 65 static int initialized = 0;
72 66
73 67 if (initialized == 0)
74 68 {
75 69 initialized = 1;
76 -#if !defined(SUN5_0) && !defined(linux)
77 -#if defined(SIGHUP)
78 - (void) bsd_signal (SIGHUP, SIG_DFL);
79 -#endif
80 -#if defined(SIGINT)
81 - (void) bsd_signal (SIGINT, SIG_DFL);
82 -#endif
83 -#if defined(SIGQUIT)
84 - (void) bsd_signal (SIGQUIT, SIG_DFL);
85 -#endif
86 -#if defined(SIGILL)
87 - (void) bsd_signal (SIGILL, SIG_DFL);
88 -#endif
89 -#if defined(SIGTRAP)
90 - (void) bsd_signal (SIGTRAP, SIG_DFL);
91 -#endif
92 -#if defined(SIGIOT)
93 - (void) bsd_signal (SIGIOT, SIG_DFL);
94 -#endif
95 -#if defined(SIGABRT)
96 - (void) bsd_signal (SIGABRT, SIG_DFL);
97 -#endif
98 -#if defined(SIGEMT)
99 - (void) bsd_signal (SIGEMT, SIG_DFL);
100 -#endif
101 -#if defined(SIGFPE)
102 - (void) bsd_signal (SIGFPE, SIG_DFL);
103 -#endif
104 -#if defined(SIGBUS)
105 - (void) bsd_signal (SIGBUS, SIG_DFL);
106 -#endif
107 -#if defined(SIGSEGV)
108 - (void) bsd_signal (SIGSEGV, SIG_DFL);
109 -#endif
110 -#if defined(SIGSYS)
111 - (void) bsd_signal (SIGSYS, SIG_DFL);
112 -#endif
113 -#if defined(SIGPIPE)
114 - (void) bsd_signal (SIGPIPE, SIG_DFL);
115 -#endif
116 -#if defined(SIGALRM)
117 - (void) bsd_signal (SIGALRM, SIG_DFL);
118 -#endif
119 -#if defined(SIGTERM)
120 - (void) bsd_signal (SIGTERM, SIG_DFL);
121 -#endif
122 -#if defined(SIGUSR1)
123 - (void) bsd_signal (SIGUSR1, SIG_DFL);
124 -#endif
125 -#if defined(SIGUSR2)
126 - (void) bsd_signal (SIGUSR2, SIG_DFL);
127 -#endif
128 -#if defined(SIGCLD)
129 - (void) bsd_signal (SIGCLD, SIG_DFL);
130 -#endif
131 -#if defined(SIGCHLD)
132 - (void) bsd_signal (SIGCHLD, SIG_DFL);
133 -#endif
134 -#if defined(SIGPWR)
135 - (void) bsd_signal (SIGPWR, SIG_DFL);
136 -#endif
137 -#if defined(SIGWINCH)
138 - (void) bsd_signal (SIGWINCH, SIG_DFL);
139 -#endif
140 -#if defined(SIGURG)
141 - (void) bsd_signal (SIGURG, SIG_DFL);
142 -#endif
143 -#if defined(SIGIO)
144 - (void) bsd_signal (SIGIO, SIG_DFL);
145 -#else
146 -#if defined(SIGPOLL)
147 - (void) bsd_signal (SIGPOLL, SIG_DFL);
148 -#endif
149 -#endif
150 -#if defined(SIGTSTP)
151 - (void) bsd_signal (SIGTSTP, SIG_DFL);
152 -#endif
153 -#if defined(SIGCONT)
154 - (void) bsd_signal (SIGCONT, SIG_DFL);
155 -#endif
156 -#if defined(SIGTTIN)
157 - (void) bsd_signal (SIGTTIN, SIG_DFL);
158 -#endif
159 -#if defined(SIGTTOU)
160 - (void) bsd_signal (SIGTTOU, SIG_DFL);
161 -#endif
162 -#if defined(SIGVTALRM)
163 - (void) bsd_signal (SIGVTALRM, SIG_DFL);
164 -#endif
165 -#if defined(SIGPROF)
166 - (void) bsd_signal (SIGPROF, SIG_DFL);
167 -#endif
168 -#if defined(SIGXCPU)
169 - (void) bsd_signal (SIGXCPU, SIG_DFL);
170 -#endif
171 -#if defined(SIGXFSZ)
172 - (void) bsd_signal (SIGXFSZ, SIG_DFL);
173 -#endif
174 -#endif
175 70 }
176 71
177 72 return;
178 73 }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX