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

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

int __write (int handle, const void *buf, size_t nbyte)
{
  ULONG rc;
  ULONG n;

  rc = DosWrite (handle, buf, nbyte, &n);
  if (rc == 0)
    return n;
  else
    {
      _sys_set_errno (rc);
      return -1;
    }
}
