1 /** @file 2 3 Implementation and Platform specific portion of <signal.h>. 4 5 Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR> 6 This program and the accompanying materials are licensed and made available under 7 the terms and conditions of the BSD License that accompanies this distribution. 8 The full text of the license may be found at 9 http://opensource.org/licenses/bsd-license. 10 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 13 **/ 14 #ifndef _SYS_SIGNAL_H 15 #define _SYS_SIGNAL_H 16 #include <sys/EfiCdefs.h> 17 #include <machine/signal.h> 18 19 /** The actual (default) signal numbers are assigned using an anonymous enum 20 so that the compiler can do the work of assigning values. This helps 21 ensure that the developer should never have to renumber the signals or 22 figure out what number to assign to a new signal. 23 24 Properly constructed programs will NEVER depend upon signal numbers being 25 in a particular order or having a particular value. All that is guaranteed 26 is that each signal number is distinct, positive, and non-zero. 27 **/ 28 enum { 29 __SigInt = 1, 30 __SigIll, 31 __SigAbrt, 32 __SigFpe, 33 __SigSegv, 34 __SigTerm, 35 __SigBreak, 36 __SigAlrm, 37 __SigVtAlrm, 38 __SigProf, 39 __SigUsr1, 40 __SigUsr2, 41 __SigWinch, 42 __SigPipe, 43 __SigQuit, 44 __Sig_Last 45 }; 46 47 /** The type of a signal handler function. **/ 48 typedef void __sighandler_t(int); 49 50 __BEGIN_DECLS 51 /** The signal function associates a "signal handler" with a signal number. 52 53 For historical reasons; programs expect signal to be declared 54 in <sys/signal.h>. 55 56 @param[in] sig Signal number that function is to be associated with. 57 @param[in] function The "handler" function to be associated with signal sig. 58 59 @return If the request can be honored, the signal function returns the 60 value of func for the most recent successful call to signal for 61 the specified signal sig. Otherwise, a value of SIG_ERR is 62 returned and a positive value is stored in errno. 63 */ 64 __sighandler_t *signal(int sig, __sighandler_t *func); 65 66 __END_DECLS 67 68 #endif /* _SYS_SIGNAL_H */ 69