2 Copyright © 2009-2012, The AROS Development Team. All rights reserved.
8 /*****************************************************************************
19 Calls the handler of a signal
22 Signal handler to be called.
26 -1: error calling handler, errno will be set.
29 The behaviour of raise() follows the BSD semantics.
30 For each signal the system keeps track of a signal handler is already
32 If not, the signal handler is called; when yes this will logged and the
33 handler will be recalled when the first handler returns. If the a new
34 handler is registered that one will be used then.
44 ******************************************************************************/
46 struct signal_func_data
*sigfuncdata
= __sig_getfuncdata(signum
);
51 /* If a signal handler raises it's own signal then the current
52 signal handler will be called when the first handler completes.
54 sigfuncdata
->flags
|= __SIG_PENDING
;
55 while (!(sigfuncdata
->flags
& __SIG_RUNNING
)
56 && (sigfuncdata
->flags
& __SIG_PENDING
)
59 __sighandler_t
*func
= sigfuncdata
->sigfunc
;
63 sigfuncdata
->flags
|= __SIG_RUNNING
; /* Signal handler is running ... */
64 sigfuncdata
->flags
&= ~__SIG_PENDING
; /* ... and not pending anymore */
69 sigfuncdata
->flags
&= ~__SIG_RUNNING
; /* Signal is not running anymore */