/* sys/getcwd.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */

#include <os2emx.h>
#include <emx/syscalls.h>
#include "syscalls.h"

int __getcwd (char *buffer, char drive)
{
  ULONG rc;
  ULONG size;

  if (drive != 0)
    drive -= 'A' - 1;
  size =512;
  rc = DosQueryCurrentDir (drive, buffer, &size);
  if (rc != 0)
    {
      _sys_set_errno (rc);
      return -1;
    }
  return 0;
}
