home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / EMXLIB8F.ZIP / EMX / LIB / SYS / GETDRIVE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-02  |  376 b   |  22 lines

  1. /* sys/getdrive.c (emx+gcc) -- Copyright (c) 1992-1993 by Eberhard Mattes */
  2.  
  3. #include <sys/emx.h>
  4. #include <os2emx.h>
  5. #include "syscalls.h"
  6.  
  7. char __getdrive (void)
  8. {
  9.   ULONG rc;
  10.   ULONG drive, map;
  11.  
  12.   rc = DosQueryCurrentDisk (&drive, &map);
  13.   if (rc == 0)
  14.     return (drive - 1 + 'A');
  15.   else
  16.     {
  17.       _sys_set_errno (rc);
  18.       return (0);
  19.     }
  20. }
  21.  
  22.