Minor fixes to comments.
[AROS.git] / rom / dos / checksignal.c
blob1ba573c85f09b3335dbe9c7a5856cb158f80d69f
1 /*
2 Copyright © 1995-2007, 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
50 LONG rcvd;
52 /* Get pointer to current task structure */
53 struct Task *me = FindTask(NULL);
55 /* Protect the signal mask against access by other tasks. */
56 Disable();
58 /* Get active signals specified in mask */
59 rcvd = me->tc_SigRecvd & mask;
61 /* And clear them. */
62 me->tc_SigRecvd &= ~mask;
64 /* All done. */
65 Enable();
67 return rcvd;
69 AROS_LIBFUNC_EXIT
70 } /* CheckSignal */