Fix for the (stupid) case of app (always) passing
[tangerine.git] / rom / dos / checksignal.c
blobef211f3cbcc68c190d2138dd0bcd17883f54c363
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Checks for signals in a mask.
6 Lang: english
7 */
8 #include <exec/tasks.h>
9 #include <proto/exec.h>
10 #include "dos_intern.h"
12 /*****************************************************************************
14 NAME */
15 #include <proto/dos.h>
17 AROS_LH1(LONG, CheckSignal,
19 /* SYNOPSIS */
20 AROS_LHA(LONG, mask, D1),
22 /* LOCATION */
23 struct DosLibrary *, DOSBase, 132, Dos)
25 /* FUNCTION
26 Checks the current task to see if any of the signals specified in
27 the mask have been set. The mask of all signals which were set is
28 returned. The signals specified in the mask will be cleared.
30 INPUTS
31 mask - The signal mask to check.
33 RESULT
34 The mask of all signals which were set.
36 NOTES
38 EXAMPLE
40 BUGS
42 SEE ALSO
44 INTERNALS
46 *****************************************************************************/
48 AROS_LIBFUNC_INIT
49 AROS_LIBBASE_EXT_DECL(struct DosLibrary *,DOSBase)
51 LONG rcvd;
53 /* Get pointer to current task structure */
54 struct Task *me = FindTask(NULL);
56 /* Protect the signal mask against access by other tasks. */
57 Disable();
59 /* Get active signals specified in mask */
60 rcvd = me->tc_SigRecvd & mask;
62 /* And clear them. */
63 me->tc_SigRecvd &= ~mask;
65 /* All done. */
66 Enable();
68 return rcvd;
70 AROS_LIBFUNC_EXIT
71 } /* CheckSignal */