blob: a9a00f8c368a0070f7eae9597eef637fd58d9f13 [file] [log] [blame] [raw]
#include <windows.h>
#include <nt.h>
//#include <errno.h>
int write(int fd, const void *buffer, size_t count) {
IO_STATUS_BLOCK io_status;
long int status = NtWriteFile((void *)fd, NULL, NULL, NULL, &io_status, buffer, count, NULL, NULL);
//printf("nativelibc debug: write: status = 0x%lx\n", status);
//if((errno = ntstatus_to_errno(status))) return -1;
if(status) return -1; // TODO: implemente the errno
return io_status.Information;
}