show more relevant debug
[AROS.git] / rom / exec / setsignal.c
blob534b613c98894f4fed4df1604bea256c2d5a61c2
1 /*
2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Examine and/or modify the signals of a task.
6 Lang: english
7 */
9 #define DEBUG 0
11 #include <exec/execbase.h>
12 #include <aros/libcall.h>
13 #include <proto/exec.h>
15 #include "exec_intern.h"
16 #if defined(__AROSEXEC_SMP__)
17 #include "etask.h"
18 #endif
20 /*****************************************************************************
22 NAME */
24 AROS_LH2(ULONG, SetSignal,
26 /* SYNOPSIS */
27 AROS_LHA(ULONG, newSignals, D0),
28 AROS_LHA(ULONG, signalSet, D1),
30 /* LOCATION */
31 struct ExecBase *, SysBase, 51, Exec)
33 /* FUNCTION
34 Change or read the set of signals sent to the current task.
36 INPUTS
37 newSignals - New values for the signals.
38 signalSet - Mask of signals affected by 'newSignals'.
40 RESULT
41 Old signal set.
43 NOTES
45 EXAMPLE
47 BUGS
49 SEE ALSO
50 AllocSignal(), FreeSignal(), Wait(), Signal(), SetExcept()
52 INTERNALS
54 ******************************************************************************/
56 AROS_LIBFUNC_INIT
58 struct Task *thisTask = GET_THIS_TASK;
59 ULONG *sig;
60 ULONG old;
62 /* Protect the signal mask against access by other tasks. */
63 Disable();
65 /* Get address */
66 sig = &thisTask->tc_SigRecvd;
68 /* Change only the bits in 'mask' */
69 old = *sig;
70 *sig = (old & ~signalSet) | (newSignals & signalSet);
72 Enable();
74 return old;
75 AROS_LIBFUNC_EXIT
76 } /* SetSignal() */