#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(ntstatus_to_errno(status)) return -1; | |
if(status) return -1; // TODO: implemente the errno | |
return io_status.Information; | |
} |