home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / aros / source / exec / signals / src / setsignal.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-16  |  1.4 KB  |  72 lines

  1. /*
  2.     $Id$
  3.     $Log$
  4.     Desc:
  5.     Lang: english
  6. */
  7. #include "exec_intern.h"
  8. #include <exec/execbase.h>
  9. #include <aros/libcall.h>
  10.  
  11. /*****************************************************************************
  12.  
  13.     NAME */
  14.     #include <clib/exec_protos.h>
  15.  
  16.     __AROS_LH2(ULONG, SetSignal,
  17.  
  18. /*  SYNOPSIS */
  19.     __AROS_LA(unsigned long, newSignals, D0),
  20.     __AROS_LA(unsigned long, signalSet, D1),
  21.  
  22. /*  LOCATION */
  23.     struct ExecBase *, SysBase, 51, Exec)
  24.  
  25. /*  FUNCTION
  26.     Change or read the set of signals sent to the current task.
  27.  
  28.     INPUTS
  29.     newSignals - New values for the signals.
  30.     signalSet  - Mask of signals affected by 'newSignals'.
  31.  
  32.     RESULT
  33.     Old signal set.
  34.  
  35.     NOTES
  36.  
  37.     EXAMPLE
  38.  
  39.     BUGS
  40.  
  41.     SEE ALSO
  42.     AllocSignal(), FreeSignal(), Wait(), Signal(), SetExcept()
  43.  
  44.     INTERNALS
  45.  
  46.     HISTORY
  47.     29-10-95    digulla automatically created from
  48.                 exec_lib.fd and clib/exec_protos.h
  49.     17-12-95    digulla Incorporated code by Matthias Fleischner
  50.  
  51. *****************************************************************************/
  52. {
  53.     __AROS_FUNC_INIT
  54.     ULONG *sig;
  55.     ULONG old;
  56.  
  57.     /* Protect the signal mask against access by other tasks. */
  58.     Disable();
  59.  
  60.     /* Get address */
  61.     sig=&SysBase->ThisTask->tc_SigRecvd;
  62.  
  63.     /* Change only the bits in 'mask' */
  64.     old=*sig;
  65.     *sig=(old&~signalSet)|(newSignals&signalSet);
  66.  
  67.     Enable();
  68.  
  69.     return old;
  70.     __AROS_FUNC_EXIT
  71. } /* SetSignal */
  72.