revert between 56095 -> 55830 in arch
[AROS.git] / rom / exec / setsignal.c
blob29c461ac58814353b947298f17f3ea4fb544bb50
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 = 0;
62 if (thisTask)
64 /* Protect the signal mask against access by other tasks. */
65 Disable();
67 /* Get address */
68 sig = &thisTask->tc_SigRecvd;
70 /* Change only the bits in 'mask' */
71 old = *sig;
72 *sig = (old & ~signalSet) | (newSignals & signalSet);
74 Enable();
77 return old;
78 AROS_LIBFUNC_EXIT
79 } /* SetSignal() */