home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / zip / gnu / mntlib16.lzh / MNTLIB16 / PAUSE.C < prev    next >
C/C++ Source or Header  |  1993-07-29  |  698b  |  41 lines

  1. /* public domain pause(), by ers */
  2.  
  3. #include <mintbind.h>
  4. #include <signal.h>
  5. #include <errno.h>
  6.  
  7. extern int __mint;
  8.  
  9. void
  10. pause()
  11. {
  12.     if (__mint)
  13.         (void)Pause();
  14.     /* do nothing for TOS */
  15. }
  16.  
  17. /*
  18.  * Aargh! Can you say "race condition"? We definitely need a Psigpause()
  19.  * call in the MiNT kernel, but for now, we fake it...
  20.  */
  21.  
  22. void
  23. sigpause(mask)
  24.     long mask;
  25. {
  26.     long oldmask;
  27.  
  28.     if (__mint == 0) {
  29.     /* for TOS, we just toggle the signal mask -- maybe
  30.      * there's a pending signal that we can receive.
  31.          */
  32.         oldmask = sigsetmask(mask);
  33.         sigsetmask(oldmask);
  34.         return;
  35.     }
  36.  
  37.     oldmask = Psigsetmask(mask);
  38.     (void)Pause();
  39.     (void)Psigsetmask(oldmask);
  40. }
  41.