Added 'Resident' field to ensure that the handler is included in the
[AROS.git] / rom / exec / setsignal.c
bloba832ba2de176fa6962d46bd94aed4fb0d8f7b64c
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Examine and/or modify the signals of a task.
6 Lang: english
7 */
8 #include <exec/execbase.h>
9 #include <aros/libcall.h>
10 #include <proto/exec.h>
12 /*****************************************************************************
14 NAME */
16 AROS_LH2(ULONG, SetSignal,
18 /* SYNOPSIS */
19 AROS_LHA(ULONG, newSignals, D0),
20 AROS_LHA(ULONG, signalSet, D1),
22 /* LOCATION */
23 struct ExecBase *, SysBase, 51, Exec)
25 /* FUNCTION
26 Change or read the set of signals sent to the current task.
28 INPUTS
29 newSignals - New values for the signals.
30 signalSet - Mask of signals affected by 'newSignals'.
32 RESULT
33 Old signal set.
35 NOTES
37 EXAMPLE
39 BUGS
41 SEE ALSO
42 AllocSignal(), FreeSignal(), Wait(), Signal(), SetExcept()
44 INTERNALS
46 ******************************************************************************/
48 AROS_LIBFUNC_INIT
50 ULONG *sig;
51 ULONG old;
53 /* Protect the signal mask against access by other tasks. */
54 Disable();
56 /* Get address */
57 sig=&SysBase->ThisTask->tc_SigRecvd;
59 /* Change only the bits in 'mask' */
60 old=*sig;
61 *sig=(old&~signalSet)|(newSignals&signalSet);
63 Enable();
65 return old;
66 AROS_LIBFUNC_EXIT
67 } /* SetSignal() */