home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / SASC6571.LZX / source / _exit.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-24  |  1008 b   |  37 lines

  1. /***
  2. *
  3. *          Copyright © 1992 SAS Institute, Inc.
  4. *
  5. * name             __exit -- standard exit function from C program
  6. *
  7. * synopsis         __exit(errcode);
  8. *                  int errcode;          exit error code
  9. *
  10. * description      This function provides a standard exit point from a
  11. *                  C program.  Control is returned to the operating
  12. *                  system under which the program is being executed.
  13. *                  The errcode parameter is sent to the system and has
  14. *                  the following meanings assigned:
  15. *
  16. *                       0 = Normal termination
  17. *                       5 = Warning
  18. *                      10 = Error
  19. *                      20 = Fatal Error
  20. *
  21. ***/
  22.  
  23. #include <stdlib.h>
  24. #include <dos.h>
  25.  
  26. void __exit(errcode)
  27.     int errcode;
  28. {
  29. #ifdef NOBASER
  30. /* this allows DATA=FARONLY functions to call exit, or __exit, */
  31. /* but not XCEXIT. */
  32.      __builtin_geta4();
  33. #endif
  34.  
  35.     _XCEXIT((long) errcode);           /*  Call exit in startup code.  */
  36. }
  37.