summaryrefslogtreecommitdiff
path: root/StdLib/Include/signal.h
diff options
context:
space:
mode:
authordarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>2011-04-27 21:42:16 +0000
committerdarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>2011-04-27 21:42:16 +0000
commit2aa62f2bc9a9654687b377d9ca8a8c2c860a3852 (patch)
tree62a0991a44327154fb88bf95bd6f7522053db7bb /StdLib/Include/signal.h
parent98790d814871cc30bbd536673d3a0948047cd2f0 (diff)
downloadedk2-2aa62f2bc9a9654687b377d9ca8a8c2c860a3852.zip
edk2-2aa62f2bc9a9654687b377d9ca8a8c2c860a3852.tar.gz
edk2-2aa62f2bc9a9654687b377d9ca8a8c2c860a3852.tar.bz2
Standard Libraries for EDK II.
This set of three packages: AppPkg, StdLib, StdLibPrivateInternalFiles; contains the implementation of libraries based upon non-UEFI standards such as ISO/IEC-9899, the library portion of the C Language Standard, POSIX, etc. AppPkg contains applications that make use of the standard libraries defined in the StdLib Package. StdLib contains header (include) files and the implementations of the standard libraries. StdLibPrivateInternalFiles contains files for the exclusive use of the library implementations in StdLib. These files should never be directly referenced from applications or other code. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11600 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'StdLib/Include/signal.h')
-rw-r--r--StdLib/Include/signal.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/StdLib/Include/signal.h b/StdLib/Include/signal.h
new file mode 100644
index 0000000..52873c7
--- /dev/null
+++ b/StdLib/Include/signal.h
@@ -0,0 +1,83 @@
+/** @file
+ The header <signal.h> declares a type and two functions and defines several
+ macros, for handling various signals (conditions that may be reported during
+ program execution).
+
+ The UEFI implementation of <signal.h> maps signals onto the UEFI
+ event mechanism.
+
+ An implementation need not generate any of these signals, except as a result
+ of explicit calls to the raise function. Additional signals and pointers to
+ undeclarable functions, with macro definitions beginning, respectively, with
+ the letters SIG and an uppercase letter or with SIG_ and an uppercase letter
+ may also be specified by the implementation. The complete set of signals,
+ their semantics, and their default handling is implementation-defined; all
+ signal numbers shall be positive.
+
+Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+#ifndef _SIGNAL_H
+#define _SIGNAL_H
+#include <sys/EfiCdefs.h>
+#include <sys/signal.h>
+
+/* The type sig_atomic_t is the (possibly volatile-qualified) integer type of
+ an object that can be accessed as an atomic entity, even in the presence
+ of asynchronous interrupts.
+
+ This, possibly machine specific, type is defined in <machine/signal.h>.
+*/
+
+/** The following three macros expand to constant expressions with distinct
+ values that have type compatible with the second argument to, and the
+ return value of, the signal function, and whose values compare unequal to
+ the address of any declarable function.
+**/
+#define SIG_IGN ((__sighandler_t *) 0)
+#define SIG_DFL ((__sighandler_t *) 1)
+#define SIG_ERR ((__sighandler_t *) 3)
+
+/** The following members expand to positive integer constant expressions with
+ type int and distinct values that are the signal numbers, each
+ corresponding to the specified condition.
+ Many existing programs expect these to be macros.
+**/
+#define SIGINT 1 ///< receipt of an interactive attention signal
+#define SIGILL 2 ///< detection of an invalid function image, such as an invalid instruction
+#define SIGABRT 3 ///< abnormal termination, such as is initiated by the abort function
+#define SIGFPE 4 ///< an erroneous arithmetic operation, such as zero divide or an operation resulting in overflow
+#define SIGSEGV 5 ///< an invalid access to storage
+#define SIGTERM 6 ///< a termination request sent to the program
+#define SIG_LAST 7 ///< One more than the largest signal number
+
+__BEGIN_DECLS
+
+/* For historical reasons; programs expect signal to be declared
+ in <sys/signal.h>. The function is documented in <sys/signal.h>.
+
+ The function is declared in the C Standard as:<BR>
+ void (*signal(int sig, void (*func)(int)))(int);
+*/
+
+/** Send a signal.
+
+ The raise function carries out the actions described for signal,
+ in <sys/signal.h>, for the signal sig. If a signal handler is called, the
+ raise function shall not return until after the signal handler does.
+
+ @return The raise function returns zero if successful,
+ nonzero if unsuccessful.
+**/
+int raise(int sig);
+
+__END_DECLS
+
+#endif /* _SIGNAL_H */