/[eiffelstudio]/FreeELKS/trunk/library/kernel/unix_signals.e
ViewVC logotype

Contents of /FreeELKS/trunk/library/kernel/unix_signals.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 91424 - (show annotations)
Tue Oct 26 18:39:32 2004 UTC (15 years, 2 months ago) by manus_eiffel
File size: 7399 byte(s)
Initial revision

1 indexing
2
3 description: "[
4 Constants used for signal handling.
5 This class may be used as ancestor by classes needing its facilities.
6 ]"
7
8 status: "See notice at end of class"
9 date: "$Date$"
10 revision: "$Revision$"
11
12 class
13 UNIX_SIGNALS
14
15 feature -- Access
16
17 meaning (sig: INTEGER): STRING is
18 -- A message in English describing what `sig' is
19 do
20 if is_defined (sig) then
21 create Result.make_from_c (c_signal_name (sig))
22 end
23 end
24
25
26 is_defined (sig: INTEGER): BOOLEAN is
27 -- Is `sig' a signal defined for this platform?
28 external
29 "C | %"eif_sig.h%""
30 alias
31 "esigdefined"
32 end
33
34 is_ignored (sig: INTEGER): BOOLEAN is
35 -- Is `sig' currently set to be ignored?
36 do
37 Result := not is_caught (sig)
38 end
39
40 Sighup: INTEGER is
41 -- Code for ``Hangup'' signal
42 once
43 Result := c_signal_map (1)
44 end
45
46 Sigint: INTEGER is
47 -- Code for ``Interrupt'' signal
48 once
49 Result := c_signal_map (2)
50 end
51
52 Sigquit: INTEGER is
53 -- Code for ``Quit'' signal
54 once
55 Result := c_signal_map (3)
56 end
57
58 Sigill: INTEGER is
59 -- Code for ``Illegal instruction'' signal
60 once
61 Result := c_signal_map (4)
62 end
63
64 Sigtrap: INTEGER is
65 -- Code for ``Trace trap'' signal
66 once
67 Result := c_signal_map (5)
68 end
69
70 Sigabrt: INTEGER is
71 -- Code for ``Abort'' signal
72 once
73 Result := c_signal_map (6)
74 end
75
76 Sigiot: INTEGER is
77 -- Code for ``IOT instruction'' signal
78 once
79 Result := c_signal_map (7)
80 end
81
82 Sigemt: INTEGER is
83 -- Code for ``EMT instruction'' signal
84 once
85 Result := c_signal_map (8)
86 end
87
88 Sigfpe: INTEGER is
89 -- Code for ``Floating point exception'' signal
90 --| (Already caught by Eiffel run-time)
91 once
92 Result := c_signal_map (9)
93 end
94
95 Sigkill: INTEGER is
96 -- Code for ``Terminator'' signal
97 once
98 Result := c_signal_map (10)
99 end
100
101 Sigbus: INTEGER is
102 -- Code for ``Bus error'' signal
103 once
104 Result := c_signal_map (11)
105 end
106
107 Sigsegv: INTEGER is
108 -- Code for ``Segmentation violation'' signal
109 once
110 Result := c_signal_map (12)
111 end
112
113 Sigsys: INTEGER is
114 -- Code for ``Bad argument to system call'' signal
115 once
116 Result := c_signal_map (13)
117 end
118
119 Sigpipe: INTEGER is
120 -- Code for ``Broken pipe'' signal
121 once
122 Result := c_signal_map (14)
123 end
124
125 Sigalrm: INTEGER is
126 -- Code for ``Alarm clock'' signal
127 once
128 Result := c_signal_map (15)
129 end
130
131 Sigterm: INTEGER is
132 -- Code for ``Software termination'' signal
133 once
134 Result := c_signal_map (16)
135 end
136
137 Sigusr1: INTEGER is
138 -- Code for ``User-defined signal #1''
139 once
140 Result := c_signal_map (17)
141 end
142
143 Sigusr2: INTEGER is
144 -- Code for ``User-defined signal #2''
145 once
146 Result := c_signal_map (18)
147 end
148
149 Sigchld: INTEGER is
150 -- Code for ``Death of a child'' signal.
151 -- Signal ignored by default
152 once
153 Result := c_signal_map (19)
154 end
155
156 Sigcld: INTEGER is
157 -- Code for ``Death of a child'' signal.
158 -- Signal ignored by default
159 once
160 Result := c_signal_map (20)
161 end
162
163 Sigio: INTEGER is
164 -- Code for ``Pending I/O on a descriptor'' signal.
165 -- Signal ignored by default
166 once
167 Result := c_signal_map (21)
168 end
169
170 Sigpoll: INTEGER is
171 -- Code for ``Selectable event pending'' signal
172 once
173 Result := c_signal_map (22)
174 end
175
176 Sigttin: INTEGER is
177 -- Code for ``Tty input from background'' signal.
178 -- Signal ignored by default
179 once
180 Result := c_signal_map (23)
181 end
182
183 Sigttou: INTEGER is
184 -- Code for ``Tty output from background'' signal.
185 -- Signal ignored by default
186 once
187 Result := c_signal_map (24)
188 end
189
190 Sigstop: INTEGER is
191 -- Code for ``Stop'' signal
192 once
193 Result := c_signal_map (25)
194 end
195
196 Sigtstp: INTEGER is
197 -- Code for ``Stop from tty'' signal
198 once
199 Result := c_signal_map (26)
200 end
201
202 Sigxcpu: INTEGER is
203 -- Code for ``Cpu time limit exceeded'' signal
204 once
205 Result := c_signal_map (27)
206 end
207
208 Sigxfsz: INTEGER is
209 -- Code for ``File size limit exceeded'' signal
210 once
211 Result := c_signal_map (28)
212 end
213
214 Sigvtalarm: INTEGER is
215 -- Code for ``Virtual time alarm'' signal
216 once
217 Result := c_signal_map (29)
218 end
219
220 Sigpwr: INTEGER is
221 -- Code for ``Power-fail'' signal
222 once
223 Result := c_signal_map (30)
224 end
225
226 Sigprof: INTEGER is
227 -- Code for ``Profiling timer alarm'' signal
228 once
229 Result := c_signal_map (31)
230 end
231
232 Sigwinch: INTEGER is
233 -- Code for ``Window size changed'' signal.
234 -- Signal ignored by default
235 once
236 Result := c_signal_map (32)
237 end
238
239 Sigwind: INTEGER is
240 -- Code for ``Window change'' signal
241 once
242 Result := c_signal_map (33)
243 end
244
245 Sigphone: INTEGER is
246 -- Code for ``Line status change'' signal
247 once
248 Result := c_signal_map (34)
249 end
250
251 Siglost: INTEGER is
252 -- Code for ``Resource lost'' signal
253 once
254 Result := c_signal_map (35)
255 end
256
257 Sigurg: INTEGER is
258 -- Code for ``Urgent condition on socket'' signal.
259 -- Signal ignored by default
260 once
261 Result := c_signal_map (36)
262 end
263
264 Sigcont: INTEGER is
265 -- Code for ``Continue after stop'' signal.
266 -- Signal ignored by default
267 once
268 Result := c_signal_map (37)
269 end
270
271
272 feature -- Status report
273
274 signal: INTEGER is
275 -- Code of last signal
276 external
277 "C | %"eif_sig.h%""
278 alias
279 "esignum"
280 end
281
282
283 feature -- Status setting
284
285 catch (sig: INTEGER) is
286 -- Make sure that future occurrences of `sig'
287 -- will be treated as exceptions.
288 -- (This is the default for all signals.)
289 -- No effect if signal not defined.
290 external
291 "C | %"eif_sig.h%""
292 alias
293 "esigcatch"
294 end
295
296 ignore (sig: INTEGER) is
297 -- Make sure that future occurrences of `sig'
298 -- will be ignored. (This is not the default.)
299 -- No effect if signal not defined.
300 external
301 "C | %"eif_sig.h%""
302 alias
303 "esigignore"
304 end
305
306 reset_all_default is
307 -- Make sure that all exceptions will lead to their
308 -- default handling.
309 external
310 "C | %"eif_sig.h%""
311 alias
312 "esigresall"
313 end
314
315 reset_default (sig: INTEGER) is
316 -- Make sure that exception of code code will lead
317 -- to its default action.
318 require
319 is_defined (sig)
320 external
321 "C | %"eif_sig.h%""
322 alias
323 "esigresdef"
324 end
325
326 feature {NONE} -- Implementation
327
328 is_caught (sig: INTEGER): BOOLEAN is
329 -- Is `sig' currently set to be caught?
330 external
331 "C | %"eif_sig.h%""
332 alias
333 "esigiscaught"
334 end
335
336 c_signal_map (i: INTEGER): INTEGER is
337 external
338 "C | %"eif_sig.h%""
339 alias
340 "esigmap"
341 end
342
343 c_signal_name (i: INTEGER): POINTER is
344 external
345 "C | %"eif_sig.h%""
346 alias
347 "esigname"
348 end
349
350 indexing
351
352 library: "[
353 EiffelBase: Library of reusable components for Eiffel.
354 ]"
355
356 status: "[
357 Copyright 1986-2001 Interactive Software Engineering (ISE).
358 For ISE customers the original versions are an ISE product
359 covered by the ISE Eiffel license and support agreements.
360 ]"
361
362 license: "[
363 EiffelBase may now be used by anyone as FREE SOFTWARE to
364 develop any product, public-domain or commercial, without
365 payment to ISE, under the terms of the ISE Free Eiffel Library
366 License (IFELL) at http://eiffel.com/products/base/license.html.
367 ]"
368
369 source: "[
370 Interactive Software Engineering Inc.
371 ISE Building
372 360 Storke Road, Goleta, CA 93117 USA
373 Telephone 805-685-1006, Fax 805-685-6869
374 Electronic mail <info@eiffel.com>
375 Customer support http://support.eiffel.com
376 ]"
377
378 info: "[
379 For latest info see award-winning pages: http://eiffel.com
380 ]"
381
382 end -- class UNIX_SIGNALS
383
384

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23