]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - StdLib/Include/signal.h
Fix a bug about the iSCSI DHCP dependency issue.
[mirror_edk2.git] / StdLib / Include / signal.h
... / ...
CommitLineData
1/** @file\r
2 This file 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 For historical reasons; programs expect signal to be declared\r
7 in <sys/signal.h>. The signal function is documented in <sys/signal.h>.\r
8\r
9 The signal function is declared in the C Standard as:<BR>\r
10 void (*signal(int sig, void (*func)(int)))(int);\r
11\r
12 The EDK II implementation of the library or base firmware does not generate\r
13 any of these signals, except as a result of explicit calls to the raise function.\r
14\r
15 Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
16 This program and the accompanying materials are licensed and made available under\r
17 the terms and conditions of the BSD License that accompanies this distribution.\r
18 The full text of the license may be found at\r
19 http://opensource.org/licenses/bsd-license.\r
20\r
21 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
22 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
23**/\r
24#ifndef _SIGNAL_H\r
25#define _SIGNAL_H\r
26#include <sys/EfiCdefs.h>\r
27#include <sys/signal.h>\r
28\r
29/* The type sig_atomic_t is the (possibly volatile-qualified) integer type of\r
30 an object that can be accessed as an atomic entity, even in the presence\r
31 of asynchronous interrupts.\r
32\r
33 This, possibly machine specific, type is defined in <machine/signal.h>.\r
34*/\r
35\r
36/** @{\r
37 The following three macros expand to constant expressions with distinct\r
38 values that have type compatible with the second argument to, and the\r
39 return value of, the signal function, and whose values compare unequal to\r
40 the address of any declarable function.\r
41**/\r
42#define SIG_IGN ((__sighandler_t *) 0)\r
43#define SIG_DFL ((__sighandler_t *) 1)\r
44#define SIG_ERR ((__sighandler_t *) 3)\r
45/*@}*/\r
46\r
47/** @{\r
48 The following macros 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 The C95 specification requires these to be macros.\r
52**/\r
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 SIGALRM __SigAlrm ///< Added for Posix timer functions\r
61#define SIGVTALRM __SigVtAlrm ///< Added for Posix timer functions\r
62#define SIGPROF __SigProf ///< Added for Posix timer functions\r
63#define SIGUSR1 __SigUsr1 ///< Added for Posix timer functions\r
64#define SIGUSR2 __SigUsr2 ///< Added for Posix timer functions\r
65#define SIGWINCH __SigWinch ///< Added for Posix timer functions\r
66#define SIGPIPE __SigPipe ///< Added for Posix timer functions\r
67#define SIGQUIT __SigQuit ///< Added for Posix timer functions\r
68#define SIG_LAST __Sig_Last ///< One more than the largest signal number\r
69/*@}*/\r
70\r
71__BEGIN_DECLS\r
72\r
73/** Send a signal.\r
74\r
75 The raise function carries out the actions described for signal,\r
76 in <sys/signal.h>, for the signal sig. If a signal handler is called, the\r
77 raise function does not return until after the signal handler does.\r
78\r
79 @return The raise function returns zero if successful,\r
80 or nonzero if unsuccessful.\r
81**/\r
82int raise(int sig);\r
83\r
84__END_DECLS\r
85\r
86#endif /* _SIGNAL_H */\r