home *** CD-ROM | disk | FTP | other *** search
/ Atari FTP / ATARI_FTP_0693.zip / ATARI_FTP_0693 / Mint / mntlib32.zoo / alarm.c < prev    next >
C/C++ Source or Header  |  1993-02-19  |  393b  |  27 lines

  1. /*
  2.  * alarm: a public domain alarm for MiNT (by ers)
  3.  */
  4.  
  5. #include <errno.h>
  6. #include <mintbind.h>
  7. #include <limits.h>
  8.  
  9. extern int __mint;
  10.  
  11. unsigned int
  12. alarm(secs)
  13.     unsigned secs;
  14. {
  15.     long r;
  16.  
  17.     if (__mint == 0)
  18.         return 0;
  19. #ifndef __MSHORT__
  20.     if (secs > ((unsigned int) (LONG_MAX/1000)))
  21.         secs = ((unsigned int) (LONG_MAX/1000));
  22. #endif
  23.     r = Talarm((long) secs);
  24.  
  25.     return (unsigned int) r;
  26. }
  27.