comparison druntime/import/core/stdc/signal.d @ 1458:e0b2d67cfe7c

Added druntime (this should be removed once it works).
author Robert Clipsham <robert@octarineparrot.com>
date Tue, 02 Jun 2009 17:43:06 +0100
parents
children
comparison
equal deleted inserted replaced
1456:7b218ec1044f 1458:e0b2d67cfe7c
1 /**
2 * D header file for C99.
3 *
4 * Copyright: Copyright Sean Kelly 2005 - 2009.
5 * License: <a href="http://www.boost.org/LICENSE_1_0.txt>Boost License 1.0</a>.
6 * Authors: Sean Kelly
7 * Standards: ISO/IEC 9899:1999 (E)
8 *
9 * Copyright Sean Kelly 2005 - 2009.
10 * Distributed under the Boost Software License, Version 1.0.
11 * (See accompanying file LICENSE_1_0.txt or copy at
12 * http://www.boost.org/LICENSE_1_0.txt)
13 */
14 module core.stdc.signal;
15
16 extern (C):
17
18 // this should be volatile
19 alias int sig_atomic_t;
20
21 private alias void function(int) sigfn_t;
22
23 version( Posix )
24 {
25 enum SIG_ERR = cast(sigfn_t) -1;
26 enum SIG_DFL = cast(sigfn_t) 0;
27 enum SIG_IGN = cast(sigfn_t) 1;
28
29 // standard C signals
30 enum SIGABRT = 6; // Abnormal termination
31 enum SIGFPE = 8; // Floating-point error
32 enum SIGILL = 4; // Illegal hardware instruction
33 enum SIGINT = 2; // Terminal interrupt character
34 enum SIGSEGV = 11; // Invalid memory reference
35 enum SIGTERM = 15; // Termination
36 }
37 else
38 {
39 enum SIG_ERR = cast(sigfn_t) -1;
40 enum SIG_DFL = cast(sigfn_t) 0;
41 enum SIG_IGN = cast(sigfn_t) 1;
42
43 // standard C signals
44 enum SIGABRT = 22; // Abnormal termination
45 enum SIGFPE = 8; // Floating-point error
46 enum SIGILL = 4; // Illegal hardware instruction
47 enum SIGINT = 2; // Terminal interrupt character
48 enum SIGSEGV = 11; // Invalid memory reference
49 enum SIGTERM = 15; // Termination
50 }
51
52 sigfn_t signal(int sig, sigfn_t func);
53 int raise(int sig);