]>
Commit | Line | Data |
---|---|---|
2aa62f2b | 1 | /** @file\r |
2 | The header <signal.h> declares a type and two functions and defines several\r | |
3 | macros, for handling various signals (conditions that may be reported during\r | |
4 | program execution).\r | |
5 | \r | |
6 | The UEFI implementation of <signal.h> maps signals onto the UEFI\r | |
7 | event mechanism.\r | |
8 | \r | |
9 | An implementation need not generate any of these signals, except as a result\r | |
10 | of explicit calls to the raise function. Additional signals and pointers to\r | |
11 | undeclarable functions, with macro definitions beginning, respectively, with\r | |
12 | the letters SIG and an uppercase letter or with SIG_ and an uppercase letter\r | |
13 | may also be specified by the implementation. The complete set of signals,\r | |
14 | their semantics, and their default handling is implementation-defined; all\r | |
15 | signal numbers shall be positive.\r | |
16 | \r | |
17 | Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r | |
18 | This program and the accompanying materials are licensed and made available under\r | |
19 | the terms and conditions of the BSD License that accompanies this distribution.\r | |
20 | The full text of the license may be found at\r | |
21 | http://opensource.org/licenses/bsd-license.php.\r | |
22 | \r | |
23 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
24 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
25 | \r | |
26 | **/\r | |
27 | #ifndef _SIGNAL_H\r | |
28 | #define _SIGNAL_H\r | |
29 | #include <sys/EfiCdefs.h>\r | |
30 | #include <sys/signal.h>\r | |
31 | \r | |
32 | /* The type sig_atomic_t is the (possibly volatile-qualified) integer type of\r | |
33 | an object that can be accessed as an atomic entity, even in the presence\r | |
34 | of asynchronous interrupts.\r | |
35 | \r | |
36 | This, possibly machine specific, type is defined in <machine/signal.h>.\r | |
37 | */\r | |
38 | \r | |
39 | /** The following three macros expand to constant expressions with distinct\r | |
40 | values that have type compatible with the second argument to, and the\r | |
41 | return value of, the signal function, and whose values compare unequal to\r | |
42 | the address of any declarable function.\r | |
43 | **/\r | |
44 | #define SIG_IGN ((__sighandler_t *) 0)\r | |
45 | #define SIG_DFL ((__sighandler_t *) 1)\r | |
46 | #define SIG_ERR ((__sighandler_t *) 3)\r | |
47 | \r | |
48 | /** The following members expand to positive integer constant expressions with\r | |
49 | type int and distinct values that are the signal numbers, each\r | |
50 | corresponding to the specified condition.\r | |
51 | Many existing programs expect these to be macros.\r | |
52 | **/\r | |
53e1e5c6 | 53 | #define SIGINT __SigInt ///< receipt of an interactive attention signal\r |
54 | #define SIGILL __SigIll ///< detection of an invalid function image, such as an invalid instruction\r | |
55 | #define SIGABRT __SigAbrt ///< abnormal termination, such as is initiated by the abort function\r | |
56 | #define SIGFPE __SigFpe ///< an erroneous arithmetic operation, such as zero divide or an operation resulting in overflow\r | |
57 | #define SIGSEGV __SigSegv ///< an invalid access to storage\r | |
58 | #define SIGTERM __SigTerm ///< a termination request sent to the program\r | |
59 | #define SIGBREAK __SigBreak ///< added for Python\r | |
60 | #define SIG_LAST __Sig_Last ///< One more than the largest signal number\r | |
2aa62f2b | 61 | \r |
62 | __BEGIN_DECLS\r | |
63 | \r | |
64 | /* For historical reasons; programs expect signal to be declared\r | |
65 | in <sys/signal.h>. The function is documented in <sys/signal.h>.\r | |
66 | \r | |
67 | The function is declared in the C Standard as:<BR>\r | |
68 | void (*signal(int sig, void (*func)(int)))(int);\r | |
69 | */\r | |
70 | \r | |
71 | /** Send a signal.\r | |
72 | \r | |
73 | The raise function carries out the actions described for signal,\r | |
74 | in <sys/signal.h>, for the signal sig. If a signal handler is called, the\r | |
75 | raise function shall not return until after the signal handler does.\r | |
76 | \r | |
77 | @return The raise function returns zero if successful,\r | |
78 | nonzero if unsuccessful.\r | |
79 | **/\r | |
80 | int raise(int sig);\r | |
81 | \r | |
82 | __END_DECLS\r | |
83 | \r | |
84 | #endif /* _SIGNAL_H */\r |