/* sys/read.c (emx+gcc) -- Copyright (c) 1992-1993 by Eberhard Mattes */

#include <sys/emx.h>
#include <os2emx.h>
#include "syscalls.h"

int __read (int handle, void *buf, size_t nbyte)
{
  ULONG rc;
  ULONG n;

  rc = DosRead (handle, buf, nbyte, &n);
  if (rc == 0)
    return (n);
  else
    {
      _sys_set_errno (rc);
      return (-1);
    }
}
