home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Collection - Online Library - January 1996 / CKITOS2196.ISO / diskette / gg244043.dsk / unc.dsk / LS30UTIL / FLUSHALL.C < prev    next >
Text File  |  1993-02-10  |  2KB  |  47 lines

  1. /****************************************************************************/
  2. /*    PROGRAM NAME: FLUSHALL.C                                              */
  3. /*    Program to flush all buffers on a system as preparation for           */
  4. /*    power off.                                                            */
  5. /*                                                                          */
  6. /*    FUNCTION:                                                             */
  7. /*    This program uses the DosShutDown() function to flush all system      */
  8. /*    buffers in preparation for a power off. This program should only be   */
  9. /*    used if any other system shutdown options are inaccessible due to     */
  10. /*    system malfunction. It can be executed by the NET RUN command from a  */
  11. /*    OS/2 LAN Requester.                                                   */
  12. /*                                                                          */
  13. /*    SIDE EFFECT:                                                          */
  14. /*    System must be restarted after program execution if the return code   */
  15. /*    is 0. Other return code indicate that the FLUSHALL program failed.    */
  16. /*                                                                          */
  17. /*    COMPILE OPTIONS:                                                      */
  18. /*    icc /C flushall.c                                                     */
  19. /*    link386 flushall;                                                     */
  20. /*                                                                          */
  21. /*    AUTHOR:                                                               */
  22. /*    Ingolf Lindberg, ITSC Austin, 1993                                    */
  23. /****************************************************************************/
  24.  
  25. #define INCL_DOSFILEMGR                /* File Manager definitions required */
  26. #include <os2.h>
  27. #include <stdio.h>
  28.  
  29. int main ( int argc, char *argv[] )
  30. {
  31.  
  32.  ULONG   ulReserved;   /* Reserved, must be zero */
  33.  APIRET  rc;           /* Return code */
  34.  
  35.  ulReserved = 0;       /* Reserved, must be set to zero */
  36.  
  37.  rc = DosShutdown(ulReserved);
  38.  if (rc != 0)
  39.  {
  40.   printf("FLUSHALL error: Return Code was : %ld", rc);
  41.   return 99;
  42.  }
  43.  
  44.  printf("FLUSHALL completed with Return Code 0\n");
  45.  
  46. }
  47.