home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c005 / 4.ddi / C / PCEXIT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1986-08-05  |  718 b   |  32 lines

  1. /**
  2. *
  3. * Name        pcexit -- Terminate the process and set the exit code
  4. *
  5. * Synopsis    pcexit(excode);
  6. *
  7. *        unsigned excode   Exit code to set
  8. *
  9. * Description    This function terminates the current process and sets
  10. *        its exit code.    The exit code can be inspected by the
  11. *        parent process using the PCWAIT function, or at the
  12. *        COMMAND.COM level by using the ERRORLEVEL batch command.
  13. *        The exit code must be no greater than 255 and no less
  14. *        than 0.
  15. *
  16. * Version    3.0 (C)Copyright Blaise Computing Inc.    1983,1984,1986
  17. *
  18. **/
  19.  
  20. #include <bprogctl.h>
  21. #include <butility.h>
  22.  
  23. void pcexit(excode)
  24. unsigned excode;
  25. {
  26.     DOSREG dos_reg;
  27.  
  28.     dos_reg.ax = utbyword(0x4c,excode);
  29.  
  30.     dos(&dos_reg);
  31. }
  32.