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

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

char __getdrive (void)
{
  ULONG rc;
  ULONG drive, map;

  rc = DosQueryCurrentDisk (&drive, &map);
  if (rc == 0)
    return drive - 1 + 'A';
  else
    {
      _sys_set_errno (rc);
      return 0;
    }
}

