Mercurial > projects > ldc
comparison tango/tango/stdc/signal.d @ 132:1700239cab2e trunk
[svn r136] MAJOR UNSTABLE UPDATE!!!
Initial commit after moving to Tango instead of Phobos.
Lots of bugfixes...
This build is not suitable for most things.
author | lindquist |
---|---|
date | Fri, 11 Jan 2008 17:57:40 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
131:5825d48b27d1 | 132:1700239cab2e |
---|---|
1 /** | |
2 * D header file for C99. | |
3 * | |
4 * Copyright: Public Domain | |
5 * License: Public Domain | |
6 * Authors: Sean Kelly | |
7 * Standards: ISO/IEC 9899:1999 (E) | |
8 */ | |
9 module tango.stdc.signal; | |
10 | |
11 extern (C): | |
12 | |
13 // this should be volatile | |
14 alias int sig_atomic_t; | |
15 | |
16 private alias void function(int) sigfn_t; | |
17 | |
18 version( Posix ) | |
19 { | |
20 const SIG_ERR = cast(sigfn_t) -1; | |
21 const SIG_DFL = cast(sigfn_t) 0; | |
22 const SIG_IGN = cast(sigfn_t) 1; | |
23 | |
24 // standard C signals | |
25 const SIGABRT = 6; // Abnormal termination | |
26 const SIGFPE = 8; // Floating-point error | |
27 const SIGILL = 4; // Illegal hardware instruction | |
28 const SIGINT = 2; // Terminal interrupt character | |
29 const SIGSEGV = 11; // Invalid memory reference | |
30 const SIGTERM = 15; // Termination | |
31 } | |
32 else | |
33 { | |
34 const SIG_ERR = cast(sigfn_t) -1; | |
35 const SIG_DFL = cast(sigfn_t) 0; | |
36 const SIG_IGN = cast(sigfn_t) 1; | |
37 | |
38 // standard C signals | |
39 const SIGABRT = 22; // Abnormal termination | |
40 const SIGFPE = 8; // Floating-point error | |
41 const SIGILL = 4; // Illegal hardware instruction | |
42 const SIGINT = 2; // Terminal interrupt character | |
43 const SIGSEGV = 11; // Invalid memory reference | |
44 const SIGTERM = 15; // Termination | |
45 } | |
46 | |
47 sigfn_t signal(int sig, sigfn_t func); | |
48 int raise(int sig); |