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

  1. /* sys/getcwd.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. int __getcwd (char *buffer, char drive)
  8. {
  9.   ULONG rc;
  10.   ULONG size;
  11.  
  12.   if (drive != 0)
  13.     drive -= 'A' - 1;
  14.   size =512;
  15.   rc = DosQueryCurrentDir (drive, buffer, &size);
  16.   if (rc != 0)
  17.     {
  18.       _sys_set_errno (rc);
  19.       return (-1);
  20.     }
  21.   return (0);
  22. }
  23.